subject

Your solution should for this assignment should consist of five (5)files: FuelGauge. h (class specification file)FuelGauge. cpp (class implementation file)Odometer. h (class specification file)Odometer. cpp (class implementation file)200_assign6.cpp (application program)★ For your sixth programming assignment, you will be implementing a program that uses two(2)classes that work together to simulate a car’s fuel gauge and odometer. The classes you will design are: TheFuelGaugeClass: This class will simulate a fuel gauge. Its responsibilities are↘To know the car’s current amount of fuel, in gallons.↘To report the car’s current amount of fuel, in gallons.↘To be able to increment the amount of fuel by 1 gallon. This simulates putting fuel in the car. (The car can hold a maximum of 15 gallons)↘To be able to decrement the amount of fuel by 1 gallon, if the amount of fuel is greater than 0 gallons. This simulates burning fuel as the car runs. TheOdometerClass: This class will simulate the car’s odometer. Its responsibilities are:↘To know the car’s current mileage.↘To report the car’s current mileage.↘To be able to increment the current mileage by 1 mile. The maximum mileage the odometer can store is 999,999 miles. When this amount is execeeded, the odometer resets the current mileage to 0.↘To be able to work with aFuelGaugeobject. It should decrease theFuelGaugeobject’s current amount of fuel by 1 gallon for every 24 miles traveled. (The car’s fuel economy is 24 miles per gallon)The FuelGaugeclass should have at least one constructor, and the appropriate member functions to get the number of gallons, increment the number of gallons, and decrement the number of gallons.★ The odometer class should have at least one constructor, and the appropriate member functions to get the mileage and increment the mileage (unfortunately you cannot decrement the mileage!).★ In the odometer class, you can have a member variable that is a pointer to a FuelGauge object. This is how you can establish a relationship between the two classes that allow them to work together. For every mile the car is driven, the odometer is increased by 1, and for every 24 miles the car is driven, the number of gallons is reduced by one.★ So in the Odometer class, one of the private member variables should be of type fuel gauge* (pointer to a FuelGauge object).★ Demonstrate the two classes by creating instances(objects)of each. 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, print the car’s current mileage and amount of fuel.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:30
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
Write an expression that will cause the following code to print "equal" if the value of sensorreading is "close enough" to targetvalue. otherwise, print "not equal". ex: if targetvalue is 0.3333 and sensorreading is (1.0/3.0), output is:
Answers: 1
question
Computers and Technology, 24.06.2019 12:10
What is it called during the editing process when the processor ensures that a character holding a coffee mug from one angle is holding the same mug in the same way when the shot switches to another camera at another angle? cinematography continuity technology prop use
Answers: 1
You know the right answer?
Your solution should for this assignment should consist of five (5)files: FuelGauge. h (class specif...
Questions
question
Chemistry, 10.03.2021 16:20
question
Mathematics, 10.03.2021 16:20
question
Spanish, 10.03.2021 16:20
Questions on the website: 13722360