Pay for 40 hours at 5 = 200
The second half of the program is similar to the first. It re-uses the variables that the first half created:
' Which earns the most money? 40 hours at $5 an hour ' or 30 hours at $6 an hour ' LET RATE = 5 LET HOURS = 40 LET PAY = HOURS * RATE PRINT "Pay for ", HOURS, "hours at ", RATE, " = " , PAY ' LET RATE = 6 LET HOURS = 30 LET PAY = HOURS * RATE PRINT "Pay for ", HOURS, "hours at ", RATE, " = " , PAY ' END
Here is how the second half of the program works:
RATE
is replaced with 6.HOURS
is replaced with 30HOURS
.RATE
.PAY
.HOURS
, gets the 30, and writes itRATE
, gets the 6, and writes it.=
PAY
, gets 180, and writes it.What does the complete program print to the screen?