Question: C++ include using namespace std An employer leaves his house by car for work every Sunday and returns every Thursday. Each day on the road,
C++ include
An employer leaves his house by car for work every Sunday and returns every Thursday. Each day on the road, the employer records the amount of gasoline put in the car. Given the starting odometer reading (that is, the odometer reading before he leaves on Sunday) and the ending odometer reading (the odometer reading after he returns home on Thursday).
Write an algorithm to calculate the average miles per gallon. Write the requirement analysis (input and output) and the algorithm in the answer box.
Sample input data is as follows:
Amount of gasoline put in the car from Sunday to Thursday: 15.75 16.30 10.95 20.65 30.00
Starting Odometer Reading: 68723
Ending Odometer Reading: 71289
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
