LET PRICE = 20000 ' PRINT "Type 1 if you want pin stripes, 0 if not" INPUT STRIPES ' IF STRIPES > 0 THEN LET PRICE = PRICE + 250 END IF ' PRINT "Type 1 if you want anti-lock brakes, 0 if not" INPUT BRAKES ' IF BRAKES > 0 THEN LET PRICE = PRICE + 800 END IF ' PRINT "Final price:", PRICE END
(There are other ways to correctly complete the program.)
This program has two IF-THEN-END
structures in it.
Each one is an option which is either
included or skipped.
Say that the user wants pin stripes but not anti-lock brakes. Here is a run of the program:
Type 1 if you want pin stripes, 0 if not ? 1 Type 1 if you want anti-lock brakes, 0 if not ? 0 Final price: 20250
What will the monitor screen look like for a user that does not want pin stripes but does want anti-lock brakes?