Answer:

The first task is to ask the user for the data. The variable names have already been decided, so this part of the program is:

'Ask the user for the data.
PRINT "Enter the first odometer reading"
INPUT FIRSTMILES
'
PRINT "Enter the second odometer reading"
INPUT SECONDMILES
'
PRINT "Enter the first gallons"
INPUT GALLONS1
'
PRINT "Enter the third odometer reading"
INPUT THIRDMILES
'
PRINT "Enter the second gallons"
INPUT GALLONS2

Calculating MPG

The miles-per-gallon for the first tank of gas can now be calculated. The miles traveled on the first tank of gas is the difference between the second and the first odometer reading. The gallons burned is, GALLONS1, the gallons used when the tank is first refilled.

'Ask the user for the data.
 . . .

'Calculate mpg for first tank of gas.
LET MPG1 = (SECONDMILES - FIRSTMILES) / GALLONS1

'Calculate mpg for second tank of gas.


'Calculate the difference between mpg rats.

'Write out the result.

END

QUESTION 7:

Fill in the QBasic statement that calculates the MPG for the second tank of gas.

(Type your answer in the box privided, or just write it on a scrap of paper.)