Answer:

The program will start out something like this:

 
'Calculate cost of fuel
'depending on grade and gallons
PRINT "How many gallons"
INPUT gallons
PRINT "What grade (R, E, or S)"
INPUT grade$
'
'Calculate cost
'
Next task goes here.

END

You might, of course, have chosen different variable names. Remember that the string variable has to end with a dollar sign, as grade$ does.

User Input Problems

Now consider the cost calculation. One of four situations will happen:

The last situation will be an error, so the program will write an error message and not calculate the cost. To make things simple, only upper case versions of "R", "E", and "S" will be accepted.

QUESTION 18:

One of four cases will be picked. What control structure is good for this?