Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8) a) Create a file containing the following car numbers, number of miles driven, and number of gallons of gas used by each car (do

image text in transcribed
8) a) Create a file containing the following car numbers, number of miles driven, and number of gallons of gas used by each car (do not include the headers): Car No.Miles Driven Galons Used 54 62 71 85 97 250 525 123 1322 235 19 38 86 14 b) Write a C+ program that reads the data in the file created in Question-8a and displays the car number, miles driven, gallons used, and the miles per gallon for each car. The output should also display the total miles driven, total gallons used, and average miles per gallon for all the cars. These totals should be displayed at the end of the output report as shown below. Hint( by using while loop) CWindowslsystem32icmd.exe Car No.Miles Driven als Used Miles/Gallon 13.1579 13.8158 20.5 15.3721 16.7857 258 19 38 123 1322 85 97 86 14 Total niles driven 2455 otxagd nloes pur gallon for all cara - 15.061:3 Press any key to continue

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 Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago