NEW
Font size
WorksheetsProcessing Conditionals Quiz Review
Total questions: 25
Worksheet time: 13mins
Which of the following code is the correct syntax for the header of a method?
void methodName();
void methodName()
methodName();
methodName()
Methods are used for code that is repeated.
True
False
There are six logical/conjunction operators in the Processing program.
True
False
What tells the computer that 'this is a method'?
quotes
parenthesis
semicolon
curly brackets
What does the following operator mean in computer programming? !
and
but
not
or
There is no semicolon after an if statement in computer programming.
False
True
Which method is run only once when the program starts?
draw
mousePressed
keyPressed
setup
What does the following operator mean in computer programming? ==
is equal to
not equal to
and
assignment
Conditional statements execute your code based on a certain condition.
False
True
The else part of a conditional statement is optional.
True
False
What does the following comparison operator mean in computer programming? >=
greater than or equal to
less than or equal to
less than
greater than
What is wrong with the following code?
if(key == g){
stroke(255,0,255);
fill(255,0,0);
rect(30, 400, 50, 310);
}
curly brackets do not belong
none of the others
no semicolon after the if statement
no quotes surrounding the g
How many relational/comparison operators are there in the Processing program?
three
four
seven
six
What does the following relational/comparison operator mean in computer programming? !=
equal to
and
not
is not equal to
How many logical/conjunction operators are there in the Processing program?
six
four
nine
three
What is the following operator called in computer programming? ||
and
or
not
but
Compound conditions are used when 2 or more conditions are checked.
True
False
Sometimes
Never
What is the following operator called in computer programming? &
and
or
not
none of the others here
The relational/comparison operators used in programming are a lot like the ones used in math classes.
True
False
Which symbol is used for AND in computer programming?
&&
||
!
$$
What is the opposite of >=?
>
==
<
<=
What is the output of the following code?
int i = 3;
if(i < 7)
println("aplus");
println("compsci");
aplus
compsci
aplus
compsci
error
What is is called when conditional statements are placed inside of one another?
inserting
casting
nesting
sub-contracting
What is the output of the following code?
int j=52;
if( j > 10 )
if( j > 20 )
if( j > 30 )
out.println("compsci");
else
out.println("speed")
compsci
speed
compsci
speed
error
What is the output of the following code?
int a=7, b=11;
if( a < 10 )
out.println("aplus");
if( b > 10 )
out.println("fun");
else
out.println("speed");
aplus
speed
aplus
aplus
fun
error
