Question: Program 1 Write an interactive C + + program that calculates the cost to fill up a person's car gas tank based on whether the
Program
Write an interactive C program that calculates the cost to fill up a person's car gas tank based on whether the person wants regular, plus, or supreme gasoline. Assume the person's gas tank is completely empty. The program should accept as input the number of gallons of gasoline the car's tank holds, and a single letter mathrmRmathrmP or S that indicates if the person needs regular, plus, or supreme gasoline. The program should work for both uppercased and lowercase letters.
If the person wants regular gasoline, the price of gas is $ per gallon.
If the person wants plus gasoline, the price of gas is $ per gallon.
If the person wants supreme gasoline, the price of gas is $ per gallon.
The program should print the cost to fill up the car's gas tank based on the type of gas selected. Print all monetary amounts to two decimal places.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
