Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ Program for the following: Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankful's

image text in transcribed
Write a C++ Program for the following: Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankful's of gasoline by recording miles driven and gallons used for each tankful. Develop a C++ program that will input the miles driven and gallons used for each tankful. The program should calculate and display the miles per gallon obtained for each tankful. After processing all input information, the program should calculate and print the combined miles per gallon obtained for all tankful's. Output Enter the gallons used (-1 to end): 16 Enter the miles driven: 220 The Miles/Gallon for this tank was 13.75 Enter the gallons used (-1 to end): 16.5 Enter the miles driven: 272 The Miles/Gallon for this tank was 16.4848 Enter the gallons used (-1 to end): -1 The overall average Miles/Gallon was 15.1385

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions