IT EOY Y8 Flashcards

Considers information such as Boolean Logic, Data Representation and p5.js (64 cards)

1
Q

What is Boolean logic?

A

A form of algebra that uses true or false values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the ‘AND’ operator do in Boolean logic?

A

It returns true if both operands are true.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

True or False: The ‘OR’ operator returns true if at least one operand is true.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the result of ‘NOT true’ in Boolean logic?

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Fill in the blank: The ‘NOR’ operator is the negation of ______.

A

OR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the truth table for the ‘AND’ operator?

A

true AND true = true; true AND false = false; false AND true = false; false AND false = false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the ‘OR’ operator return if both operands are false?

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or False: ‘NOT false’ gives a true result.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the primary use of Boolean logic in programming?

A

To control the flow of execution based on conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a truth table?

A

A table that shows all possible values of logical expressions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the result of ‘true NOR true’?

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In p5.js, what function is used to create a canvas?

A

createCanvas()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Fill in the blank: The ‘draw()’ function in p5.js is called ______.

A

continuously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of the ‘setup()’ function in p5.js?

A

To initialize variables and settings before the drawing starts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the ‘background()’ function do in p5.js?

A

Sets the color used for the background of the canvas.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

True or False: p5.js is a JavaScript library for creative coding.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the syntax for declaring a variable in p5.js?

A

var variableName;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the default size of the canvas in p5.js if not specified?

A

100x100 pixels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What function is used to draw shapes in p5.js?

A

The draw() function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does the ‘fill()’ function do in p5.js?

A

Sets the color used to fill shapes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How do you create a random number between 0 and 1 in p5.js?

A

Using the random() function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the output of ‘false OR false’?

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the result of ‘true AND false’?

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What does ‘true OR NOT false’ evaluate to?

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Fill in the blank: The output of 'NOT (true AND false)' is ______.
true
26
What is the purpose of the 'keyPressed()' function in p5.js?
To execute code in response to a key press event.
27
True or False: The 'rect()' function in p5.js draws a rectangle.
True
28
What is the syntax for creating a for loop in p5.js?
for (var i = 0; i < limit; i++) { }
29
What does the 'stroke()' function do in p5.js?
Sets the color for the outline of shapes.
30
What will 'true AND true AND false' evaluate to?
false
31
What is the result of 'true NOR false'?
false
32
What does the 'noLoop()' function do in p5.js?
Stops the draw function from executing continuously.
33
True or False: The 'text()' function in p5.js is used to display text on the canvas.
True
34
What is the output of 'NOT (false OR true)'?
false
35
What is the result of 'false NOR true'?
false
36
What is the primary purpose of Boolean operators?
To perform logical operations on binary values.
37
What does the 'createButton()' function do in p5.js?
Creates a new button element.
38
Fill in the blank: The 'ellipse()' function in p5.js draws a ______.
circle or oval
39
What is the syntax to create a color in p5.js?
color(r, g, b)
40
What does the 'mousePressed()' function do in p5.js?
Executes code when the mouse is pressed.
41
What is the output of 'NOT true AND false'?
false
42
What is the primary data structure used in p5.js for storing multiple values?
Array
43
What is the result of 'true OR true AND false'?
true
44
True or False: The 'noFill()' function in p5.js removes the fill color from shapes.
True
45
What does the 'loadImage()' function do in p5.js?
Loads an image file.
46
What will 'false AND true AND NOT false' evaluate to?
false
47
What is the output of 'NOT (true OR false)'?
false
48
Fill in the blank: The 'beginShape()' function in p5.js starts a new ______.
shape
49
What is the result of 'true AND NOT false'?
true
50
What is the purpose of the 'random()' function in p5.js?
To generate random numbers.
51
True or False: The 'frameRate()' function in p5.js sets the number of frames per second.
True
52
What does the 'textSize()' function do in p5.js?
Sets the size of the text to be displayed.
53
What is the output of 'false AND false OR true'?
true
54
What is the purpose of the 'noStroke()' function in p5.js?
Removes the outline from shapes.
55
What is the result of 'true NOR false AND true'?
false
56
Fill in the blank: The 'background(255)' function sets the background to ______.
white
57
What does the 'createSlider()' function do in p5.js?
Creates a slider input element.
58
What is the output of 'true AND true OR false'?
true
59
What is the result of 'false OR NOT true'?
false
60
What does the 'textAlign()' function do in p5.js?
Sets the alignment of the text.
61
What is the syntax for creating a conditional statement in p5.js?
if (condition) { }
62
What does the 'image()' function do in p5.js?
Displays an image on the canvas.
63
True or False: The 'translate()' function in p5.js moves the origin of the canvas.
True
64
What is the output of 'true OR false AND false'?
true