stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Processing Test Review Flashcards | StudBud
Explore
/
Processing Test Review
Processing Test Review
20 terms
·
StudBud Administration
·
456 plays
multiple choice review on main programming concepts in Processing. #ics2o #programming
Flashcards
20 cards
F
Practice quiz
P
Host live
L
Questions
20
Answers
1
In order to
check if the user inputs the integer 5
you need to use this statement:
if (key - 48 = 5) {
if( int(key) - 48 == 5 ) {
if( int(key) ==5 ) {
if ( key ==5 ) {
2
Consider this line:
strokeWeight (5);
This line declares the stroke color as Red
This line declares a stroke line 5 pixels thick
This line declares a stroke line as 5 pixels long
This line declares a stroke color as Blue
3
What is the missing line of the following program that outputs 0, 10, 20, 30, 40, etc.
x ++;
x== x + 10;
x +10;
x = x + 10;
4
If
y
is from type
int
, what does this statement do:
y = 32%4+5*2
It checks to see if y is equal to 10
It stores 18 in the variable y
It stores 10 in thevariable y
It outputs 18
5
Which of the following shapes will move without changing its dimensions?Default modes are used!
rect(x,y,50,50);
ellipse(x,y,x+50, y+50);
rect(x,y,x+50, y+50);
rect(50,50,100,100);
6
In Processing the difference between System and Custom variables is that:
System require declaring and the Custom don’t
Custom require declaring and the System don’t
Custom vars are type int andSystem vars are type float
Custom vars are type float andSystem vars are type int
7
What does the fourth number control:
fill (255,0,10,210);
the red color
the hue
the transparency
the saturation
8
What is missing in the following code that will make a small rectangle appear randomly?
The rectangle will never showError in the inner if statement
||
&&
The rectangle will never show.Error in the drawing statement
9
How do
x
and
y
change when moving an object down - left on the screen
x increases, y decreases
both x & y decrease
x decreases, y increases
both x & y increase
10
What should you write in a program to cause the entire screen to become gray?
grayBackground();
Background(150);
background(150);
noBackground();
11
If
sum = 60;
and
count = 4;
what will be the output of
print (“The total average is:”,sum/count);
Syntax Error
The total average is: 15 is printed on the console
The total average is: 15 is printed on the screen
Nothing is printed, because it’s a comment
12
What will be printed as a result of the following statements:
Hello Mrs G
Hello
will not print anything - Error
Bye Mrs G
13
In Processing :
setup() and draw() are executed continuously
draw() is executedcontinuously and setup() - only once
setup() and draw() are executed only once
draw() is executed continuously,but setup()is not necessary
14
Which is a correct use of an
else
statement:
} else (key == ’N’ || key == ’n’) {
} else() {
} else {
} else (key == ’N’) {
15
If you want to move an object to the right with an arrow key, which condition will you choose:
key== CODED
key== CODED && keyCode==RIGHT
keyCode== RIGHT
keyPressed && key == CODED
16
A logic error in a program will:
cause syntax issues
produce an unexpected result
stop the program from running
make the program print Error messages
17
Which command will allow you to draw a rectangle using its width & height :
rect (x
1
, y
1
, w, h)
rectmode(CORNERS);
rectMode(RADIUS);
rectmode(CORNER);
rectMode(CENTER);
18
What will be the printed after the following code is executed
11
Error
4
7
19
One of the following variables is NOT declared correctly:
Boolean state = 1;
int counter = 6 ;
char answer = ‘N’;
float yRef = 5.0 ;
20
What does this code output?
6
7
5
8