After running this code:
var x = 5;
x += 3;
What is the value of x?
What is 8?
100
How many different colors will appear on the screen?
What is 3?
100
What color will the circle be if the var number = 1.5?
What is yellow?
100
I would use this loop if I DIDN'T know how many iterations I needed to carry out in my code.
What is a while loop?
100
Arrays are useful for storing the following EXCEPT
integers, strings, functions, booleans
What are functions?
200
In the following code, we define a variable and use it to draw a rectangle:
var rectWidth = 45;
rect(10, 10, rectWidth/3, rectWidth);
How wide is the rectangle?What is 15?
What is 15?
200
What color hues do x, y, and z represent in this example?
fill(x, y, z);
What is Red, Green, Blue?
200
Color of the circle is var number = 1.
What is yellow?
200
What is the error in the following for loop?
for (i = 1; i < 6; i--){
}
Variable i is not defined.
200
What is the syntax for creating an array with 3 values?
var example = [x, y, z]
300
Write the JavaScript code to print "Happy Holidays!" at x=100 and y=200.
text("Happy Holidays!", 100, 200)
300
Describe what this program does. (Hint: it was one of our challenges!)
It will draw a yellow sun in a blue sky with a green ground. The sun grows bigger and bigger as the program runs to fill up the whole sky.
300
True or False: it is possible for var number = 3.
What is no?
300
What is the output of the following while loop?
var i = 0;
while (i < 3) {
print("Let it snow ");
i++;
}
What is "Let it snow Let it snow Let it snow"
400
What is the value of candy_cane in the following code?
var candy_cane = 5 + 3 * 8 / 6 - 2?
What is 7?
400
Change one of the lines to change the color of the sun to any other color.
What is
//red
fill(250, 0, 0);
ellipse(200, 298, sunSize, sunSize);
400
True or False: It is possible for var number = 0
What is true?
400
Create a for loop that has the following output:
11111
2222
333
44
5
for (var i = 1; i <= 5; i++){
for(var j = 5; j >= 1; j--){
println(i);
}
}
400
Given the array myPresents, what is the result of the following code?
text(myPresents[1], 50, 200)
What is barbie?
500
What is the value of snowflake in this expression?
var snowflake = "snow" + 2 + 19 % 5 - (11 * (5 / 2)) + " 4 / 1"
What is "snow16 4 / 2"?
500
Change the code to make the size of the sun increase 10x faster.
What is
sunSize = sunSize + 10;
500
Edit one line of the code so that the circle will always be purple.
What is
if (number < 3) {
//purple
fill(111, 0, 255);
}
500
What is the outcome of the following code?
var star = 12;
var jingle_bell = -1;
while (jingle_bell < 3) {
star -= 1;
jinglebell += 1;
}
println(star / jingle_bell);
What is 2?
500
What is the result of the following code?
for (var i = 1; i < myPresents.length; i++){
text(myPresents[i - 1], 200, (100 * i));
}