RULES FOR VARIABLE
DECLARATION
RULES FOR VARIABLE DECLARATION
O Variable name only start with a letter, an underscore ( _ ), of a dollar sign
( $ ).
O The variable name should start with only letters
O White spaces are not allowed between characters of variable but
undersores are approved.
O The variable name is case sensitive –TEMP and temp is different
variable.
O No two variables of same name are allowed to be declared in the same
scope.
O Every variable used must be declared.
O Javascript allows declaration statements anywhere in the list of
statements.
O Variable declarations announce what variables will be used in the
program.
O A variable must be declared before it can be used.
O Declaration statements can also be used to store an initial value into
declared variables.
O Variable name cannot start with a number.
RULES FOR VARIABLE DECLARATION
O In java a variable name cannot start with a didit or hyphen.
O Al variable can be “31” character long for many compiler.
O Key word are not used as variable name.
O Blank spaces special symbols commas are not used.
O The first letter of the variable must be character of
underscore.
O The java languafe is case sensitive which implies that the
variable num in lowercase is different from variable num in
upper case.
O Declaring an initial value of variable in the declaration
statement is optional.
O Variable may be declared in a list.
O Both lower case and higher case digits are distinct.
Purpose of lab 1
O It was a general lab. In lab 1 we have studied about
of python and learned about how to join google class.
O Program 1:
O This program will display my name.
O Code: Print (“Shaher Bano”)
O Output:
O Mr. Usman
O Program 2:
O This program will display members of my family.
O Code: Print (“there are four members in my family.”)
O Output:
O there are four members in my family.
Program 3:
O This program will display the table of two.
Code:
O Print (“2x1=2”)
O Print (“2x2=4”)
O Print (“2x3=6”)
O Print (“2x4=8”)
O Print (“2x5=10”)
O Print (“2x6=12”)
O Print (“2x7=14”)
O Print (“2x8=16”)
O Print (“2x9=18”)
O Print (“2x10=20”)
Output:
O 2x1=2
O 2x2=4
O 2x3=6
O 2x4=8
O 2x5=10
O 2x6=12
O 2x7=14
O 2x8=16
O 2x9=18
O 2x10=20
O Program 4:
O This program will display my favorite book.
O Code: Print (“Mathematics”)
O Output:
O Mathematics
O Program 5:
O This program will display the addition of three
digits.
O Code: Print (“2+2+3”)
O Output:
O 2+2+3
Thanks you…..

Rules for Variable Declaration

  • 1.
  • 2.
    RULES FOR VARIABLEDECLARATION O Variable name only start with a letter, an underscore ( _ ), of a dollar sign ( $ ). O The variable name should start with only letters O White spaces are not allowed between characters of variable but undersores are approved. O The variable name is case sensitive –TEMP and temp is different variable. O No two variables of same name are allowed to be declared in the same scope. O Every variable used must be declared. O Javascript allows declaration statements anywhere in the list of statements. O Variable declarations announce what variables will be used in the program. O A variable must be declared before it can be used. O Declaration statements can also be used to store an initial value into declared variables. O Variable name cannot start with a number.
  • 3.
    RULES FOR VARIABLEDECLARATION O In java a variable name cannot start with a didit or hyphen. O Al variable can be “31” character long for many compiler. O Key word are not used as variable name. O Blank spaces special symbols commas are not used. O The first letter of the variable must be character of underscore. O The java languafe is case sensitive which implies that the variable num in lowercase is different from variable num in upper case. O Declaring an initial value of variable in the declaration statement is optional. O Variable may be declared in a list. O Both lower case and higher case digits are distinct.
  • 4.
    Purpose of lab1 O It was a general lab. In lab 1 we have studied about of python and learned about how to join google class. O Program 1: O This program will display my name. O Code: Print (“Shaher Bano”) O Output: O Mr. Usman O Program 2: O This program will display members of my family. O Code: Print (“there are four members in my family.”) O Output: O there are four members in my family.
  • 5.
    Program 3: O Thisprogram will display the table of two. Code: O Print (“2x1=2”) O Print (“2x2=4”) O Print (“2x3=6”) O Print (“2x4=8”) O Print (“2x5=10”) O Print (“2x6=12”) O Print (“2x7=14”) O Print (“2x8=16”) O Print (“2x9=18”) O Print (“2x10=20”)
  • 6.
    Output: O 2x1=2 O 2x2=4 O2x3=6 O 2x4=8 O 2x5=10 O 2x6=12 O 2x7=14 O 2x8=16 O 2x9=18 O 2x10=20
  • 7.
    O Program 4: OThis program will display my favorite book. O Code: Print (“Mathematics”) O Output: O Mathematics O Program 5: O This program will display the addition of three digits. O Code: Print (“2+2+3”) O Output: O 2+2+3
  • 8.