questiongas mileage drivers are concerned with


Question

Gas Mileage Drivers are concerned with mileage obtained by their automobiles. One driver has kept track of some tankfuls of gasoline by recording miles driven and gallons used for each tankful. Expand a C++ program that uses a as statement to input the miles driven and gallons used for each tankful. Program must calculate and display the miles per gallon obtained for each tankful and print combined miles per gallon obtained for all tankfuls up to this point.

Enter miles driven (-1 to quit): 287
Enter gallons used: 13
MPG this tankful: 22.076923
Total MPG: 22.076923
Enter miles driven (-1 to quit): 200
Enter gallons used: 10
MPG this tankful: 20.000000
Total MPG: 21.173913
Enter miles driven (-1 to quit): 120
Enter gallons used: 5
MPG this tankful: 24.000000
Total MPG: 21.678571
Enter miles driven (-1 to quit): -1

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: questiongas mileage drivers are concerned with
Reference No:- TGS0444509

Expected delivery within 24 Hours