[solved] – Question 82492
Gas PumpA gas pump calculates the cost of gas at a local gas station. The station charges $2.59 per gallon for regular grade gas, $2.79 per gallon for special grade gas, and $2.99 per gallon for super grade gas. Create an application that simulates the functionality of the gas pump. The user picks a grade of gas, and then enters the number of gallons. The program then displays the purchase details and the charge of the purchase.Define a void function namedgasCost, which accepts a char as the gas grade selected and a double as the number of gallons purchased as arguments. The function then calculates and displays the purchase details and total cost. For example: You purchased 38.25 gallons Regular grade gas at $2.59 per gallon. Your payment is $ 99.07. Write a program that prompts the user for the gas grade, and number of gallons, passes the values to the gasCost() function and then displays the charge on the console.
Expert Answer
OR

