Cars with LESS THAN 20000 annual miles qualify for a discount.
IF MILEAGE < 20000 THEN
The program is nearly finished. All we need to do now is to fill in the part of the program that decides between the two discount rates.
PRINT "Please enter the base rate" INPUT BASERATE PRINT "Please enter annual mileage" INPUT MILEAGE IF MILEAGE < 20000 THEN Decide between 5% and 10% discount ELSE LET DISCOUNT = 0.0 ' no discount for high milage cars END IF PRINT "Your base rate is", BASERATE PRINT "Your discount is", DISCOUNT PRINT "You pay", BASERATE * (1 - DISCOUNT) END
This part of the program will be a nested IF (sometimes called an inner IF because it is nested inside the first one.) It will decide between two cases:
There are several equally good ways that this inner IF could be written. Here is one way:
IF MILEAGE < 20000 THEN IF car gets 10% rate THEN LET DISCOUNT = .1 ELSE LET DISCOUNT = .05 END IF ELSE LET DISCOUNT = 0 END IF
Fill in a relational expression for the part that determines if the car gets 10% rate for annual mileage LESS THAN 10000.