Answer:

Yes.

Gas Pump Program

Time for a new example program. Say that a gasoline pump has three grades of fuel:

  1. Regular — costs $1.20 a gallon.
  2. Extra — costs $1.30 a gallon.
  3. Super — costs $1.40 a gallon.

The program will ask the user for how many gallons were pumped, and then for a letter, "R", "E", or "S" that says what grade of fuel was pumped. The program will then calculate the cost and print it out.

For now, just concentrate on a plan for the program:

  1. Ask the user for data.
  2. Calculate the cost and print it out.

QUESTION 17:

Write the QBasic statements for the first task of the program. You will need a string variable for the letter.