All About Loops
Variables
IF statements
Shapes
Arrays
100
What are loops used for in programming?
To repeat tasks
100

What are two variables commonly used in our class?

x and y

100

Complete the if statement:

If you complete all your work, and attend all your classes, then ....

answers may vary

100

rect is the code used to create what shape? 

rectangle

100

What is the index of the starting value in an array always?

0

200

When the number of times to loops is unknown, what type of loop do we use?

What is while loops?

200

Which line of code shows the variable declaration? (slide 7)

line 34
200

What is an if statement in computer science?

It is code that tells the program to run under certain conditions. "if this.. then that"

200

From looking at the below code, Walk us through what each parameter value represents. 

rect(20,25,70,40);

20-x coordinate

25-y coordinate

70-width

40-height

200

Find the two errors in this array code. (slide 12)

there is a missing quotation mark after bananas, all the y values are the same

300

What situations are for loops used in?

When the number of times to loop is known (Repeat 'x' times)

300

What is a reasonable variable declaration for this while loop? (slide 8)

var y=0

300

Fill in the blanks

 if (y ){

        yspeed=2;

}

(slide 15)

 if (y<100){

        yspeed=2;

}

300

Write the code for the ellipse seen here (slide 9).

ellipse(100,100,50,75);


300

What is the line of code that would access Zamani from the below array of teachers? 


var scienceTeachers= ["Negassi", "Smith", "Dassler","Zamani", "Hasan"];

scienceTeachers[3]

400

What are the parameters for the ellipse in the while loop? (slide 5)

x,350,25,25

400

Where and when do we use variable declarations (that you've learned in this class)?

Loops, Animations, functions & anywhere that lines of code are being repeated

400

Fill in the blank for a bottom ball bounce ( slide 16)

if (        ){ 

yspeed = - 2;

}

if (y > 300){ 

yspeed = - 2;

}

400

Write the code for the rectangle seen here including the code for its color. (slide 9).


fill(255, 0, 0);

rect(150,200,100,100,30);

400

Identify three major issues in this array code (slide 13).

-the fill function is missing thus the text will not show up

-all of the index values are 0

-there is a missing semicolon; after the bottom text line

500

What is the syntax for creating repeating images such as the grass below? (slide 6)

var grass = getImage("cute/GrassBlock");


var x = 0;

while (x <= 400){

    // Draw the grass once

    image(grass, x, 270);

    x+=100;

}



500

What parameters do we use for x and y, to make the mouse interactive?

mouseX, mouseY

500

What is the if statement for the below ball bounce? (slide 14)

if(x<100){xSpeed=2;}

500

Write the code for the triangle seen here. (slide 11)

fill(255, 0, 0);

triangle(200,100,100,250,300,250);

500

Write the expression that we would use to count up how many values are in an array of video games? 

videoGames.length

M
e
n
u