Miscellaneous
Functions
Variables
Shapes
Animations
100

What are comment codes? What symbol do we use for it?

Labels the code


//

100

What is the name of this function?

multiply

100

What are two rules in variable naming?

1. camelCase

2. not too long

100

rect is the code used to create what shape? 

rectangle

100

What is the name of the function we use to code animations?

the draw function

200

How can we animate a ball to go diagonally from the top left corner to the bottom right corner? Just show incrementation or decrementation needed

x++;

y++;

200

What is the difference between functions using random notation and functions with parameters? 

Functions using random means you can place the position of objects randomly however functions with parameters mean you can place set the position in specific places. 

200

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

line 34
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

Show the direction of movement we would get if we had a decrementation like below:  

y--;

it would be a movement from bottom to top in the upwards direction

300

What is the alt attribute in coding used for? 

To describe what is happening in text. Helps the blind

300

Identify the error-Why isn’t this student’s call functions working?

They need to get rid of their variable declarations (line 35, line36)

300

What is a reasonable variable declaration for this while loop? 

var y=0

300

Write the code for the ellipse seen here .

ellipse(100,100,50,75);


300

How can the student fix this issue in the code?Write the exact code they need.

background(255);

400

Write the text code to say hello in the center of a 400x400 canvass. Size doesn't matter. 

text ("hello", 200,200, 200);

400

Write the function calls for the below image with the function name cookie

cookie(50,50);

cookie(350,50);

cookie(50,50);

cookie(200,200);

cookie(350,350);

400

When do we use variable declarations (that you've learned in this class)? Where in the code is it placed?

Animations, functions

For animations it is placed before the draw function


400

Write the code for the rectangle seen here including the code for its color.


fill(255, 0, 0);

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

400

What are two different ways that you can write the incrementation of a ball you want to move from left to right at a speed of 1?

x+=1;

x++;

500

Write the code for this arc.

fill(255);

arc(200,200,200,200,0,180);

500

Write the function definition and call for finding the area of a rectangle

//write your function defintion here

var areaOfRectangle=function(width,height){

    return width*height;

};




//call the function here

var area = areaOfRectangle(2,9);


500

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

mouseX, mouseY

500

Write the code for the triangle and line seen here. (all pertinent code)

fill(255, 0, 0);

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

500

Complete the code that should be in the red boxes

-replace the x's

-add in the incrementation