WorksheetsJavaScript Midterm Review
Total questions: 27
Worksheet time: 14mins
Which one of the following symbols is used for JavaScript comments?
\\
^
;
//
Which command draws a rectangle?
rec (10, 20, 100, 200);
rect (10, 20, 100, 200);
rect (10, 20);
ellispse (10, 20, 40, 40)
Which command colors the background of your canvas?
background
var = color
endShape
fill
Which command removes the outlines from shapes?
noOutline();
noBorder();
noColor();
noStroke();
What command draws a perfect circle?
ellispse (80, 60, 100, 105);
ellipse (80, 60, 100, 100);
circle (80, 60, 80, 60);
ellipse (80, 60, 105, 100);
What command colors a shape?
color (43, 255, 0);
fill (43, 255, 0);
bucket (43, 255, 0);
bucketFill (43, 255, 0);
What is at the end of a line of code?
#
;
,
"
The "stroke" command means
The "stroke" command means
color outside a shape
color of blocks
border
What does the "fill" command do?
put letters in the shape
put pictures in the shape
put color in the shape
put code in the shape
A variable is used to
store a value in memory
draw a circle
store a value that does not change
draw a rectangle
JavaScript uses the keyword ___ to define variables.
vrb
var
vari
va
What is JavaScript?
a programming language
HTML tags
an alphabet
an alphabet
Color values range from
0-255
10-200
0-355
0-200
To fill a shape with the color white you would use which code?
fill ( 255, 255, 255);
background (255, 255, 255);
fill (0, 0, 0);
fill (255, 255, 255, 255);
Which command would you use to change the thickness of a line?
strokeWeight
noStroke
borderWeight
stroke
To fill a shape with the color black you would use which code?
color (255, 255, 255);
fill (255, 255, 255);
fill (0, 0, 0);
fill (0, 0, 0)
In a fill command, the colors of the parameters in order are:
r, b, g
r, r, g
b, g, r
r, g, b
The command var stands for ___.
variation
variable
varizon
very special
If I wanted to draw an oval, I would use the ___ command.
oval
circle
ellipse
ell
If I wanted to draw a square, I would use the ____ command.
squ
ellipse
square
rect
If I want my line to be thicker, I would use the ___ command.
strokeWeight
noStroke
strokeThick
lineWeight
The numbers in the parentheses of a command are called ___.
parameters
numbers
codes
partners
rect(175, 175, 50, 50)
rect(100, 350, 20, 50);
rect(175, 175, 50, 50);
rect(50, 350, 20, 50);
ellipse(80, 150, 90, 170);
ellipse(150, 80, 90, 170);
ellipse(80, 150, 20, 20);
ellipse(150, 80, 50, 50);
Which is a shortcut for x = x + 1?
++ x
x ++ 11
x == 1
x++
Which is a shortcut for x = x + 1?
x =+
x ++=
x += 1
x +=+ 1
When you use a draw function, where do you have to assign the variables?
BEFORE the function
IN the function
AFTER the function
