wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Processing Conditionals Quiz Review

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

Which of the following code is the correct syntax for the header of a method?

a)

void methodName();

b)

void methodName()

c)

methodName();

d)

methodName()

2.

Methods are used for code that is repeated.

a)

True

b)

False

3.

There are six logical/conjunction operators in the Processing program.

a)

True

b)

False

4.

What tells the computer that 'this is a method'?

a)

quotes

b)

parenthesis

c)

semicolon

d)

curly brackets

5.

What does the following operator mean in computer programming? !

a)

and

b)

but

c)

not

d)

or

6.

There is no semicolon after an if statement in computer programming.

a)

False

b)

True

7.

Which method is run only once when the program starts?

a)

draw

b)

mousePressed

c)

keyPressed

d)

setup

8.

What does the following operator mean in computer programming? ==

a)

is equal to

b)

not equal to

c)

and

d)

assignment

9.

Conditional statements execute your code based on a certain condition.

a)

False

b)

True

10.

The else part of a conditional statement is optional.

a)

True

b)

False

11.

What does the following comparison operator mean in computer programming? >=

a)

greater than or equal to

b)

less than or equal to

c)

less than

d)

greater than

12.

What is wrong with the following code?

if(key == g){

stroke(255,0,255);

fill(255,0,0);

rect(30, 400, 50, 310);

}

a)

curly brackets do not belong

b)

none of the others

c)

no semicolon after the if statement

d)

no quotes surrounding the g

13.

How many relational/comparison operators are there in the Processing program?

a)

three

b)

four

c)

seven

d)

six

14.

What does the following relational/comparison operator mean in computer programming? !=

a)

equal to

b)

and

c)

not

d)

is not equal to

15.

How many logical/conjunction operators are there in the Processing program?

a)

six

b)

four

c)

nine

d)

three

16.

What is the following operator called in computer programming? ||

a)

and

b)

or

c)

not

d)

but

17.

Compound conditions are used when 2 or more conditions are checked.

a)

True

b)

False

c)

Sometimes

d)

Never

18.

What is the following operator called in computer programming? &

a)

and

b)

or

c)

not

d)

none of the others here

19.

The relational/comparison operators used in programming are a lot like the ones used in math classes.

a)

True

b)

False

20.

Which symbol is used for AND in computer programming?

a)

&&

b)

||

c)

!

d)

$$

21.

What is the opposite of >=?

a)

>

b)

==

c)

<

d)

<=

22.

What is the output of the following code?

int i = 3;

if(i < 7)

println("aplus");

println("compsci");

a)

aplus

compsci

b)

aplus

c)

compsci

d)

error

23.

What is is called when conditional statements are placed inside of one another?

a)

inserting

b)

casting

c)

nesting

d)

sub-contracting

24.

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")

a)

compsci

b)

speed

c)

compsci

speed

d)

error

25.

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");

a)

aplus

speed

b)

aplus

c)

aplus

fun

d)

error