WorksheetsJavaScript Variables
Total questions: 26
Worksheet time: 16mins
Which is of the following not correct rule for writting variables names.
These need to be in the lowercase or camel case
spaces are allowed while naming these.
These could be mix of letters, Numbers, _ or $
you cannot start with a number
Variable is not case sensitive
True
False
One of the follwing statements is correct
var myVariable = "Hello"
var myVariable = /Hello/
var myVariable = "Hello'
var myVariable = Hello
which the camel case variable name is correct
var my _code_date = "c"
var myCodeDate = "c"
var MycodeDate = "c"
var MyCodeDate = "c"
Which of the following operator is used for the Assignment Operator?
==
!
=
+
4 types of variables are:
Boolean, String, int, double
Boolean , String, Variable, conditions
Boolean , String, Numbers, loops
Boolean , String, ints, while loops
Variables are useful because they allow us because:
they store data and delete the programs
store data and change the results of a program.
change the results of a program only and does not store data,
A variable is like a container with a name that can hold a value.
True
False
Kyle is writing a program. He wants to use a variable that can store the money information. The money will have decimal points so he can display exact change. Which variable he needs to use.
Boolean
String
Float
Integer
Madison is creating a JavaScript program. She likes to add some information that must print as is. She knows that she will need "" around her data but what type of variable she is using.
String
Boolean
Ints
Float
We use the following to Declare a variable for the first time.
var
numApples
bool
variable
String variables are not a sequence of characters.
true
false
Which one is the correct print statement.
println(numPlates);
println(numCars)
println(numHouses;
printLn(numCups);
How would you create a variable named: myHouse and give it a value "123 Dove St. Valley, CA, 99999".
Which is of the following not correct rule for writting variables names.
These need to be in the lowercase or camel case
spaces are allowed while naming these.
These could be mix of letters, Numbers, _ or $
you cannot start with a number
What programming language did we learn in class this week?
Karel
Java
JavaScript
Visual Basic
Which of these is a loop?
if(x<10)
while(x<10)
var x=10;
text(x,10;10)
Greater than or equal to
> or =
> || =
>=
<=
Repeat something 10 times
repeat 10
for (var i=0; i<10; i++)
repeat { } until 10;
while (i = 10)
When we are done with a line what do we put at the end?
a colon :
a semi-colon ;
a period .
a quotation mark "
When we surround a word with quotes "David" it's called ?
a program
a loop
a string
a command
