IT EOY Y8 Flashcards
Considers information such as Boolean Logic, Data Representation and p5.js (64 cards)
What is Boolean logic?
A form of algebra that uses true or false values.
What does the ‘AND’ operator do in Boolean logic?
It returns true if both operands are true.
True or False: The ‘OR’ operator returns true if at least one operand is true.
True
What is the result of ‘NOT true’ in Boolean logic?
false
Fill in the blank: The ‘NOR’ operator is the negation of ______.
OR
What is the truth table for the ‘AND’ operator?
true AND true = true; true AND false = false; false AND true = false; false AND false = false.
What does the ‘OR’ operator return if both operands are false?
false
True or False: ‘NOT false’ gives a true result.
True
What is the primary use of Boolean logic in programming?
To control the flow of execution based on conditions.
What is a truth table?
A table that shows all possible values of logical expressions.
What is the result of ‘true NOR true’?
false
In p5.js, what function is used to create a canvas?
createCanvas()
Fill in the blank: The ‘draw()’ function in p5.js is called ______.
continuously
What is the purpose of the ‘setup()’ function in p5.js?
To initialize variables and settings before the drawing starts.
What does the ‘background()’ function do in p5.js?
Sets the color used for the background of the canvas.
True or False: p5.js is a JavaScript library for creative coding.
True
What is the syntax for declaring a variable in p5.js?
var variableName;
What is the default size of the canvas in p5.js if not specified?
100x100 pixels
What function is used to draw shapes in p5.js?
The draw() function.
What does the ‘fill()’ function do in p5.js?
Sets the color used to fill shapes.
How do you create a random number between 0 and 1 in p5.js?
Using the random() function.
What is the output of ‘false OR false’?
false
What is the result of ‘true AND false’?
false
What does ‘true OR NOT false’ evaluate to?
true