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, 22.06.2019 06:50
Type the correct answer in the box. spell all words correctly. which view of report creation allows you to customize the report before the database program creates it? creating a report in allows you to customize the report before the database program creates it. pl asap
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 23.06.2019 16:00
What is the biggest difference between section breaks and regular page breaks? section breaks are more difficult to add than page breaks. section breaks make it easier for you to view the document as an outline. section breaks allow you to have areas of the document with different formatting. section breaks are smaller than regular page breaks.
Answers: 2
You know the right answer?
Your solution should for this assignment should consist of five (5)files: FuelGauge. h (class specif...
Questions
question
Mathematics, 29.12.2019 17:31
question
English, 29.12.2019 17:31
question
Mathematics, 29.12.2019 17:31
Questions on the website: 13722362