Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Questions on computer programming (for JavaScript)

Total questions: 7

Worksheet time: 7mins

Name
Class
Date
1.

What does the rect(); function do in JavaScript?

a)

It draws an ellipse/circle.

b)

It draws a rectangle.

c)

It draws a triangle.

d)

It makes a text box.

2.

In a boolean expression, what's the operator that substitutes for the = sign?

a)

!==

b)

<=

c)

===

d)

>=

3.

In JavaScript, what's the operator that substitutes for the "×" sign?

a)

+

b)

*

c)

-

d)

/

4.

How do you declare a variable called "x" that has a value of 77?

a)

this.x is 77

b)

var x = 77

c)

I can't remember!!!!!

5.

Which of the following is are examples of single-line comments? Choose all that apply.

a)

comment = Apples are red.

b)

// Violets are blue.

c)

# I love programming!

d)

// Do you?

6.

What does the "%" operator do?

a)

It divides two numbers and takes the remainder. For example 6\ \%\ 5=1 because 6÷5=1, remainder 1.6÷5=1,\ remainder\ 1.

b)

It divides the number to the left of it by 100; like in regular math. So 6% = 61006\%\ =\ \frac{6}{100} because of the statement.

7.

True or false. 4 <= -3

(a)