What are comment codes? What symbol do we use for it?
Labels the code
//
What is the name of this function?
multiply
What are two rules in variable naming?
1. camelCase
2. not too long
rect is the code used to create what shape?
rectangle
What is the name of the function we use to code animations?
the draw function
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
y++;
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.
Which line of code shows the variable declaration? (slide 7)
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
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
What is the alt attribute in coding used for?
To describe what is happening in text. Helps the blind
Identify the error-Why isn’t this student’s call functions working?
They need to get rid of their variable declarations (line 35, line36)
What is a reasonable variable declaration for this while loop?
var y=0
Write the code for the ellipse seen here .
ellipse(100,100,50,75);
How can the student fix this issue in the code?Write the exact code they need.
background(255);
Write the text code to say hello in the center of a 400x400 canvass. Size doesn't matter.
text ("hello", 200,200, 200);
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);
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
Write the code for the rectangle seen here including the code for its color.
fill(255, 0, 0);
rect(150,200,100,100,30);
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++;
Write the code for this arc.
fill(255);
arc(200,200,200,200,0,180);
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);
What parameters do we use for x and y, to make the mouse interactive?
mouseX, mouseY
Write the code for the triangle and line seen here. (all pertinent code)
fill(255, 0, 0);
triangle(200,100,100,250,300,250);
Complete the code that should be in the red boxes
-replace the x's
-add in the incrementation