Question: Design a set of classes that work together to simulate a car's fuel gauge and odometer. The classes designed will include The FuelGauge class: this

Design a set of classes that work together to simulate a car's fuel gauge and odometer. The classes designed will include The FuelGauge class: this class will simulate a fuel gauge and will be responsible for 1. 2. 3. Knowing the car's current amount of fuel in gallons Reporting the car's current amount of fuel in gallons Incrementing the amount of fuel by one (1) gallon (putting fuel in the car) a. The car can hold a maximum of 15 gallons of fuel Decrementing the amount of fuel by 1 gallon (if the amount of fuel is greater than 0 gallons (simulating burning fuel as the car runs) 4. The Odometerclass: this class will simulate the car's odometer and will be responsible for: 1. 2. 3. Knowing the car's current mileage Reporting the car's current mileage Incrementing the car's current mileage by 1 mile The maximum is 999,999 miles When this amount is exceeded, the odometer resets the current mileage to zero a. b. 4. Working with the fuelGauge object Decreasing the FuelGauge object's current amount of fuel by 1 gallon for every 24 miles travelled a. Requirements Create instances of each, and simulate filling the car up with fuel, and then run a loop that increments the odometer until the car runs out of fuel. During each loop iteration, output the car's current mileage and the current amount of fuel The program must use a separate *.h file and a separate *.cpp for the fuel gauge and for the odometer....so you will have five (5) files. Projects Symbols File /I Chapter 14, Progra ming Challenge 15: Car Instrume #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
