Answer:

  IF ANSWER$ = "YES" THEN
    LET PRICE = 1.50
  ELSE
    LET PRICE = .89
  END IF

Complete program

nested decisions flow chart

The program is now complete:

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)"
  INPUT ANSWER$

  IF ANSWER$ = "YES" THEN
    LET PRICE = 1.50
  ELSE
    LET PRICE = .89
  END IF

END IF

PRINT "Your beverage costs:", PRICE
END

The program is not very "user friendly" because the user must answer exactly YES (in capital letters) to make a choice. We could make the program more user friendly, but this would take many more statements.

QUESTION 9:

The user is asked only two questions: about coffee and about tea. How does the user choose milk?