WorksheetsHour of Code - Drawing with Code
Total questions: 15
Worksheet time: 45mins
Function names are always followed by parentheses
True
False
What is another word for a command?
Prompt
Parameter
Function
Debugging
What is the reason we use parameters?
To create a lot of functions
To make is easier for the user to input values when playing a game.
To be able to go back and fix error in the code and make it easier to debug.
To modify existing function and make them easier to customize or change when being called.
What is the JavaScript command for drawing a rectangle?
(a)
What is the JavaScript command to draw a circle (hint: it's not "circle")?
(a)
If you wanted to draw a basic eyebrow on a face, what command would you use?
(a)
What changes the thickness of a line?
lineWeight
strokeWeight
stroke
lineStroke
When drawing an ellipse, what are the 4 parameters you must add?
X
Y
Radius
Width
Height
Do you want to build a snowman?
Yes
No
Did you have fun this week?
Yes
No
When adding a RGB color, to a background for example, what is the range of colors for each segment (Red, Green, Blue)?
-255 to +255
0 to 255
0 to 400
-400 to +400
Identify the error in the code:
background(79, 232, 232);
// The ground
fill(118, 179, 65);
rect(0, 300, 400, 100);
\\ The sun
fill(250, 244, 65);
ellipse(80, 64, 100, 100);
line 1
line 3
line 5
line 7
Identify the line of code with the error:
fill(250, 244, 65);
ellipse(80, 64, 100, 100);
// The snowman
fill(240, 106, 245);
ellipse(200, 300, 150, 150);
ellipse(200, 200, 100, 100);
ellipse(200, 120, 75,, 75);
line 1
line 3
line 5
line 7
Identify the line of code with the error:
fill(250, 244, 65);
ellipse(80, 64, 100, 100);
// The snowman
fill(240, 106, 245);
ellipse(200, 300, 150, 150);
ellipse(200, 200, 100, 100);
ellipse(200, 120, 75, 75);
triangle(50, 50, 50, 100, 100, 300)
line 2
line 4
line 6
line 8
Identify the line of code with the error:
fill(250, 244, 65);
ellipse(80, 64, 100, 100);
rect(33, 14, 97);
triangle(50, 50, 50, 100, 100, 300);
line 1
line 2
line 3
line 4
