wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quizizz JavaScript Attempt 2 Review

Total questions: 25

Worksheet time: 1hrs 10mins

Name
Class
Date
1.

Look at the image. What is the line of code for the rectangle?

a)

rect (400, 400);

b)

ellipse (200, 400);

c)

rect (0, 0);

d)

ellipse (0, 0);

2.

Find the bug! Why is the rectangle not red?

a)

The parameters in line 1 are incorrect.

b)

The fill code should come first.

c)

There is no background code.

d)

There is no stroke code.

3.

What are parameters in code?

a)

the outside measurement of a room

b)

the name of a shape

c)

the specific details in a line of code

d)

the line numbers in a program

4.

Why do programmers use the //Comment line of code?

a)

to tell the computer what to say

b)

to keep their program organized

c)

to tell the user to input information

d)

to add text to their program

5.

What do we call a piece of code that STORES information to be used later on in the program?

a)

variable

b)

random number

c)

ellipse

d)

storage

6.

What does the randomNumber code do to our program?

a)

switches our program order

b)

adds variables

c)

makes it react differently each time

d)

writes the code for us

7.
Indicates the beginning  and the end of a JavaScript section.
a)
<html> </html>
b)
<style> </style>
c)
<article> </article>
d)
<script> </script>
8.
In JavaScript, you should include a semi-colon at the end of each statement.
a)
yes
b)
no
9.

Which command is written correctly?

a)

Move

b)

move

c)

Move();

d)

move();

10.
Programming and scripting languages are translated into this machine-readable form.
a)
Syntax
b)
Binary Code
c)
Compiler
d)
Operator
11.
What surrounds a string?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
12.

How many times will a for loop iterate if the condition is 'i < 5' and the initial value of i is 0?

a)

5

b)

1

c)

0

d)

2

13.

What is the purpose of a while loop in JavaScript?

a)

To skip a block of code

b)

To execute a block of code only once

c)

To repeatedly execute a block of code as long as a specified condition is true.

d)

To terminate the execution of a loop

14.

Which of the following operator is used for the Assignment Operator?

a)

==

b)

!

c)

=

d)

+

15.

What is the symbol used for the INCREMENT operator in JS?

a)

+

b)

++

c)

=

d)

==

16.

Conditions return values of which data type?

a)

Integer

b)

boolean

c)

floating-point

d)

string

17.

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++;

a)

10

b)

11

c)

9

d)

12

18.

What is the value of x at the end of the code?

var i;

var x=0;

for(i =0; i<10; i++){

x++;

}

a)

10

b)

11

c)

9

d)

12

19.

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++;

a)

10

b)

9

c)

11

d)

12

20.

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--;

a)

11

b)

12

c)

13

d)

10

21.

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++;

a)

58

b)

51

c)

49

d)

59

22.

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?

a)
b)
c)
d)
23.

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!”

a)

12

b)

15

c)

18

d)

“Good afternoon!”

24.

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?

a)

It is raining and 30°F

b)

It is raining and 55°F

c)

It is not raining and 45°F

d)

It is not raining and 50°F

25.

What will the following program do when run?

var number = readLine("Enter a number: ");

println("Number is: " + number);

a)

The program will ask the user for a number and then will print Number is: with the number they entered

b)

The program will ask the user for a number and then will print Number is:

c)

The program will print Number is:

d)

The program will print Enter a number: and then print Number is:

CHECK