Question: Using c++, Please make sure the output looks like sample 1 and sample 2. Implement a class named GasPump that will be used to model

Using c++, Please make sure the output looks like sample 1 and sample 2.

Implement a class named GasPump that will be used to model a pump at a gas station. A GasPump object should be able to perform the following tasks: - Display the amount of gas dispensed - Display the total amount charged for the amount of gas dispensed - Set the cost per gallon on gas - Display the cost per gallon of gas - Reset the amount of gas dispensed and amount charged before each new usage - Keep track of the amount of gas dispensed and the total charge When implementing the GasPump class, you should assume that the gas pump dispenses .10 gallons of gas per second. Write a test program in main() that prompts the user to enter the cost per gallon of gas and how many seconds they want to pump gas for. Then, display the number of gallons of gas pumped, the cost per gallon of gas, and the total cost of the gas.

Using c++, Please make sure the output looks like sample 1 andsample 2. Implement a class named GasPump that will be used to

O SAMPLE RUN #1: ./GasPumpe Interactive SessionInvis blos Show Highlighted Only Highlight: None Enter the cost per gallon of gasi Enter-the.amount.of seconds you.want.to pump gas for:342 The.gas.punp dispensed. 34.2.gallons of gas. At $4.25 per-gallon,your-total.is $145.35

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!