The four statements that previously preceded the DO
statement
must be moved inside the DO
... LOOP
so they are repeated
every time.
The statements now
between the DO
and WHILE
are repeated each time the loop body is executed.
' Retail price calculator ' with markup entered by the user ' for each item DO PRINT "Enter the amount of markup in percent" INPUT MARKUP LET RATE = 1 + MARKUP / 100 PRINT "The price multiplier is:", RATE 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
Do statements inside of a loop look much different from those that are not?