# Module 5 Review Game

## Quiz by Katrina Knoedl

### Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

31 questions
• Q1

Mitsuyo is working with a game level designer on a new video game. The designer sends the information below:

Is the enemy strength at least 12?

True:  Subtract 6 from player health

False:  Subtract 2 from player health.

She must implement that logic in code, using the variables enemyStrength and playerHealth.Which of these code snippets correctly implements the logic provided above?Choose 1 answer:

30s
• Q2

With if statements, our programs can execute a set of instructions only if the condition is false.

false
true
True or False
30s
• Q3

Marcie is developing a program to assign pass/fail grades to students in her class, based on their percentage grades.

Their college follows this grading system:

60% and above    PASSLower than 60%    FAIL

The variable percentGrade represents a student's percentage grade, and her program needs to set grade to the appropriate value.

Which of these code segments correctly sets the value of grade?Note that there are 2 answers to this question. Choose the correct answers:

30s
• Q4

The code below processes two numerical values with a conditional statement.

The code displays whichever number is greater (num1 or num2) or displays numB if they are equal.

The code displays whichever number is smaller (num1 or num2) or displays num2 if they are equal.

The code either displays whichever number is greater (num1 or num2) or displays numA if they are equal.

30s
• Q5

The general syntax for an if statement is:

30s
• Q6

Computer programs make decisions using Boolean expressions inside __________.Correct Answer

comparison operators

variables

conditionals

instructions

30s
• Q7

In the code below, the statement "n is a positive number!" will only be printed if which condition is true?

The value of variable n is equal to seven

The value of variable n is greater than zero

The value of variable n is less than zero

30s
• Q8

The instruction portion of an if statement is limited to only 5 lines of code.

false
true
True or False
30s
• Q9

We cannot store the results of a boolean expression as a variable.

false
true
True or False
30s
• Q10

The code below is from a sign-up form. It accepts two string inputs from a user and then processes them with a conditional statement.

The code displays "Looks good!" if the two emails are equal, and displays "Try again!" otherwise.

The code displays "Looks good!" if the two emails are different, and displays "Try again!" otherwise.

The code displays "Looks good!" if the two emails are equal once they're lowercased, and displays "Try again!" otherwise.

30s
• Q11

If Statements will always evaluate to either true or false.

true
false
True or False
30s
• Q12

What is not one of the 3 parts to an if statement?

(condition)

{instructions}

variable

if

30s
• Q13

After the following code runs, what will be displayed?

x is a positive number!

x is a positive number!

End Program

0

End Program

30s
• Q14

What symbol would be used for "strictly not equal to?"

!==

=!

+=

<=

30s
• Q15

In the code below, the user is told to wear sunscreen if which of the following conditions is true?

degreesOutside = 50

OR

numberOfClouds = 50

degreesOutside < 70

AND

numberOfClouds < 5

degreesOutside < 70

OR

numberOfClouds < 5

30s

Teachers give this quiz to your class