Q3+Exam

=Javascript= I've decided to make the exam in this class useful instead of boring and unnecessary. Use the embedded or linked content to complete the exam for Q3. This comes from Khan Academy's Computer Science Course -- It's just like Codeavengers (not really) but on steroids and Red Bull... I'll embed the content for you to use (if I can) otherwise click the link to view the stuff and then come back to answer the questions that follow. Got it?

media type="custom" key="22565066"

1. What is the first thing that you need to "pound into your head" before getting started?
> a. Computers are smarter than humans > b. You are smarter than a computer > c. Programming is hard > d. Programming is not as useful as it used to be

2. Every line of code ends with a ``_________``.
> a. semicolon > b. period > c. exclamation point > d. curly braces

media type="custom" key="22565068"

3. In a rect function call, what do the first two numbers in the parentheses represent?
> a. width and height > b. height and width > c. x and y coordinates of the lower right-hand corner of the rectangle > d. x and y coordinates of the upper left-hand corner of the rectangle

4. Draw a triangle (use the "Documentation" tab). What do the six parameters represent?
> a. first two give the focal point, the other four determine orientation > b. first four determine orientation, the last two give the focal point > c. x and y coordinates for each of the three points > d. the draw three touching lines

media type="custom" key="22565208"

5. What are the three primary colors in the additive color model?
> a. red, yellow, and blue > b. red, orange, green > c. cyan, fuchsia, yellow > d. red, green, blue

6. If you have 255 set as the value of each of the three parameters in a "fill", what color does it produce?
> a. white > b. black > c. depends on which color model you're using > d. red, green, and blue

7. How do I create an object that is transparent?
> a. set 255 as the value of each of the three parameters in a fill > b. set 0 as the value of each of the three parameters in a fill > c. use the noFill function leaving the parameters blank > d. do not set a function for color

media type="custom" key="22565286"

8. Which of the following evaluates to 10 (remember PMDAS)?
a. code format="javascript" 36 - 4 / 8 + 6 code

b. code format="javascript" 16 - 6 * 10 / 5 code

c. code format="javascript" 5 + 30 / ( 40-23) code

d. code format="javascript" 5 + 30 / 6 code

media type="custom" key="22565072"

9. What does the equals sign following the name of the variable mean?
> a. same as math class, "equals" > b. has no meaning > c. represents that the variable and the value are the same > d. means assignment

media type="custom" key="22565430"

10. What happens when a variable is written on the right hand side of an equals sign?
> a. it becomes just the value it was assigned (so sad!) > b. has no meaning > c. represents that the variable and the value are the same > d. it amplifies what the variable can do

media type="custom" key="22565518"

11. What does translate do?
> a. changes the language > b. changes the values > c. shifts the entire canvas according to the coordinates used > d. recognizes a difference in position

12. What does scale do?
> a. rotates the canvas around the center > b. affects the outer edges of the canvas > c. magnifies or shrinks the horizontal and vertical planes (stretch and squish) > d. recognizes a difference in position

13. What does rotate do?
> a. affects the outer edges of the canvas > b. rotates the canvas around the center > c. shifts the entire canvas according to the coordinates used > d. recognizes a difference in position

14. What does the value for rotate represent?
> a. radians of the arc created by the rotation > b. the angle at which the canvas rotates around the origin > c. x and y coordinates of the lower left corner of the rotated object > d. recognizes a difference in position

media type="custom" key="22565626"

15. How do you make an object drawn move?
> a. write a loop so that it gets drawn over and over again > b. write the same code in consecutive functions adding a "nudge" > c. embed a moving object > d. it is not possible in Javascript