Why did not all of the statements in the false branch execute?

Answer:

The entire false branch is like a "little program." It has its own control structure, which skips statements depending on the user's answer.

Little Programs

Once you know that the false branch is executed, you can concentrate on the "little program" like this:


PRINT "Do you want coffee? (Answer YES or NO)"
INPUT ANSWER$

IF ANSWER$ = "YES" THEN
  LET PRICE = 1.05

ELSE
  ' decide between tea and milk
  PRINT "Do you want tea? (Answer YES or NO)"  <--- start here
  INPUT ANSWER$                                <--- YES

  IF ANSWER$ = "YES" THEN                      <--- true
    LET PRICE = 1.50                           <--- true branch is executed
  ELSE
    LET PRICE = .89                            <--- false branch is skipped
  END IF


END IF

PRINT "Your beverage costs:", PRICE
END

QUESTION 12:

Now do you understand why you should have had Jolt for breakfast?