About this Quiz

This P5.js Class 8 MCQ test contains random 30 Objective Questions. You have select one correct answer among given options.

P5.js Class 8 MCQ With Answers

1. What are the parameters in the 'createCanvas' function?

  • No parameters
  • x and y coordinates
  • color of the canvas
  • width and height

2. Which function in p5 is executed only once?

  • draw()
  • rect()
  • setup()
  • createCapture()

3. Which are correct ways to add color to a shape in p5.js?

  • fill(‘yellow’);
  • fill(255,255,0);
  • fill(‘#ebe12d’);
  • All Of above

4. __________________ are the values inside of the parentheses following the name of the function. These values will be different based on the information that the function needs.

  • Variables
  • Function
  • Arrays
  • Parameters

5. ______________ are lines of code that perform specific tasks.

  • Variables
  • Functions
  • Loops
  • Conditionals

6. You can use the 'random' function to randomly select the values for any function that uses numeric parameters.

  • True
  • False

7. MouseX and mouseY are variables that represent...

  • The location of the mouse on the X and Y axis.
  • The location of your drawing on the x and y axis.
  • The size of the canvas.
  • NONE

8. RGB, colors range from ___ to ___.

  • 0 - 100
  • 0 - 255
  • 0 - 250
  • 50 - 550

9. What, is the difference between function setup () and function draw()?

  • Function setup is a loop and function draw only runs once.
  • There are no differences.
  • Function setup runs once and function draw is a loop.
  • Function setup and function draw are both loops but they allow the programmer to do different things.

10. How many parameters are there in the code for drawing a line in p5.js?

  • 4
  • 2
  • 3
  • 5

11. What is a correct code to create a rectangle in p5.js?

  • rect();
  • rectangle(20,20,40,50);
  • rect(40,120,120,40);
  • rect(40,120);

12. Which of the following is an example of a built in variable in P5.js?

  • background
  • width
  • varX
  • mouse

13. Which code sets the canvas' color to "pink" in p5.js?

  • background-color('pink');
  • bg('pink');
  • background('pink');
  • bg-color('pink');

14. What is p5.js ?

  • It is a header file
  • It is programming language
  • It is a Javascript library
  • It is an online compiler

15. When using 'RGB' to fill the color of a shape, the 4th parameter 'a' controls the __________ of the color.

  • stroke
  • weight
  • size
  • transparency

16. What is the y coordinate of the following ellipse?ellipse(70, 120, 150, 180);

  • 70
  • 120
  • 150
  • 180

17. What function do we use to create circle?

  • ellipse()
  • line()
  • arc()
  • circle()

18. What function do we use to add color to a shape in p5.js?

  • color();
  • fill();
  • paint();
  • noFill();

19. The area where all drawn graphics are displayed is known as the...

  • console
  • drawing area
  • canvas
  • pallete

Enjoyed the Quiz. Share this with friends

Comments

Add Your Review

Your email address will not be published.

Subscribe to Newsletter!

Subscribe to get latest updates and information.