NEW
Font size
WorksheetsQuizizz JavaScript Attempt 2 Review
Total questions: 25
Worksheet time: 1hrs 10mins
Look at the image. What is the line of code for the rectangle?
rect (400, 400);
ellipse (200, 400);
rect (0, 0);
ellipse (0, 0);
Find the bug! Why is the rectangle not red?
The parameters in line 1 are incorrect.
The fill code should come first.
There is no background code.
There is no stroke code.
What are parameters in code?
the outside measurement of a room
the name of a shape
the specific details in a line of code
the line numbers in a program
Why do programmers use the //Comment line of code?
to tell the computer what to say
to keep their program organized
to tell the user to input information
to add text to their program
What do we call a piece of code that STORES information to be used later on in the program?
variable
random number
ellipse
storage
What does the randomNumber code do to our program?
switches our program order
adds variables
makes it react differently each time
writes the code for us
Which command is written correctly?
Move
move
Move();
move();
How many times will a for loop iterate if the condition is 'i < 5' and the initial value of i is 0?
5
1
0
2
What is the purpose of a while loop in JavaScript?
To skip a block of code
To execute a block of code only once
To repeatedly execute a block of code as long as a specified condition is true.
To terminate the execution of a loop
Which of the following operator is used for the Assignment Operator?
==
!
=
+
What is the symbol used for the INCREMENT operator in JS?
+
++
=
==
Conditions return values of which data type?
Integer
boolean
floating-point
string
What is the value of Z at the end of the code?
var x = 5;
var y = x;
y++;
x--;
var z = x +y;
z++;
10
11
9
12
What is the value of x at the end of the code?
var i;
var x=0;
for(i =0; i<10; i++){
x++;
}
10
11
9
12
What is the value of c at the end of the code?
var a = 20;
var b = 14;
a++;
b--;
var c = a - b;
c++;
10
9
11
12
What is the value of Z at the end of the code?
var x = 25;
var y = 11;
y++;
x++;
var z = x - y;
z--;
11
12
13
10
What is the value of t at the end of the code?
var w = 13;
var s = 45;
w++;
s--;
var t = w + s;
t++;
58
51
49
59
Karel the Dog is instructed to move forward two spaces. Then, if Karel is standing on a ball, Karel will turn left and move forward two spaces. Otherwise, Karel will turn around and move forward two spaces. Given the starting point below, where will Karel end up?
Consider the following program code, where hours is an input from the user.
if(hours <= 12){
println("Good morning!");
} else if(hours < 16){
println("Good afternoon!");
} else {
println("Hello!");
}
Of the following choices, select the value for hour that would cause this program to print “Good Afternoon!”
12
15
18
“Good afternoon!”
Eliza will wear a coat if it is raining or if it is less than 50° F outside. Otherwise, Eliza will leave her coat at home.
In which of the following cases will Eliza leave her coat at home?
It is raining and 30°F
It is raining and 55°F
It is not raining and 45°F
It is not raining and 50°F
What will the following program do when run?
var number = readLine("Enter a number: ");
println("Number is: " + number);
The program will ask the user for a number and then will print Number is: with the number they entered
The program will ask the user for a number and then will print Number is:
The program will print Number is:
The program will print Enter a number: and then print Number is:
CHECK
