Answer:

Pay for   40   hours at  5  =  200

Second Half of the Program

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:

  1. The value in RATE is replaced with 6.
  2. The value in HOURS is replaced with 30
  3. The LET statement:
    • Uses the value 30 in HOURS.
    • Uses the value 6 in RATE .
    • Performs the calculation 30 * 6
    • Stores the result, 180, in PAY .
  4. The PRINT statement:
    • Writes Pay for
    • Looks in HOURS, gets the 30, and writes it
    • Writes hours at
    • Looks in RATE , gets the 6, and writes it.
    • Writes =
    • Looks in PAY, gets 180, and writes it.

QUESTION 22:

What does the complete program print to the screen?