Search Header Logo

Nested and Compound Conditionals Quiz

Authored by Michael Weingarden

Computers

12th Grade

Nested and Compound Conditionals Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the `onMousePress` function in this code?

To move the eyes on the face

To change the background color of the face

To toggle the mouth of the clicked face between '-' and 'o'

To draw a new face at the mouse location

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of conditional structure is used to check the location of the mouse click?

Simple `if` statements

Switch-case statement

Compound and nested `if`/`elif` statements

Try-except blocks

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which face changes when you click in the top-left quadrant of the screen (mouseX = 200)):`

`if ((mouseX > 300) and (mouseY > 300)):`

`if ((mouseX = 200) and (mouseY >= 200)):`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What kind of conditional is used inside each quadrant check?

A try-except

A nested if-else

A while loop

A switch-case

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the initial value of each face's mouth?

'-'

'o'

'neutral'

Undefined

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times is `drawFace` called in the program?

2

3

4

It depends on mouse clicks

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?