Multiple choice

Directions: Use the following program segment:

IF Time < Best THEN PRINT "NEW WORLD RECORD!" ELSEIF Time < Best + 10 THEN PRINT "GOOD RACE" ELSE PRINT "AVERAGE RACE" END IF

If Time equals 120 and Best equals 121, what is output when this statement is executed?

  1. NEW WORLD RECORD!

  2. GOOD RACE

  3. AVERAGE RACE

  4. Nothing is output

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

When Time=120 and Best=121, the condition (Time < Best) is true (120 < 121), so the first branch executes and prints 'NEW WORLD RECORD!' The ELSEIF and ELSE clauses are never reached.