Please note global variables are not allowed to use in this assignment except of global constants.
GasPump Class
A gas pump calculates the cost of gas at a local gas station. The station charges $2.54 per gallon for regular grade gas, $2.89 per gallon for special grade gas, and $2.99 per gallon for super grade gas. Write a C++ program that create a class namedGasPumpthat contains the following private member variables and public member functions:
“Your purchase is 38 gallons Regular grade gas at $2.54 per gallon.”
“Your payment is $96.52.”
In the main function, prompts the user to enter the gas grade and the number of gallons, and then creates aGasPumobject and displays the purchase details by calling thecost()function.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here