It would be nice to see the RATE
printed out just once, just after the
user entered the MARKUP
amount.
The revised program is given below:
The PRINT
statement should be the fourth statement of the sequential
statements in front of the DO
:
' Retail price calculator ' with markup entered by the user PRINT "Enter the amount of markup in percent" INPUT MARKUP LET RATE = 1 + MARKUP / 100 PRINT "The price multiplier is:", RATE DO PRINT "Enter wholesale price" ' ask the user for the wholesale price INPUT WHOLESALE ' get the price, put it in a variable PRINT "Retail price:", WHOLESALE * RATE ' compute and print out the retail price LOOP END
When the program starts up, the first four statements will be done in sequence:
Enter the amount of markup in percent ? 10 The price multiplier is: 1.1
After that, the program runs as before.