Question: Program: struct Here is the struct that you need to create for your program: C++ struct Manufacturer (string), Model (string), Year built (string), Car miles

Program:

struct

Here is the struct that you need to create for your program:

C++ struct

Manufacturer (string), Model (string), Year built (string), Car miles per gallon (double)

Functions

Here are the functions to create:

Function Name

Return Type

Parameter List

(Car &c)

This function should load all car information from the CarInfo.txt file. The data is passed back in the reference parameter. Just read the data from the file and put the data into the appropriate fields of the Car struct instance.

(double m[])

The array to populate is passed in. Fill the array with data from the CarMileage.txt file.

(Car c, double mileage[], double gasCostPerGallon)

Use the information passed in to calculate the yearly gas cost. This method should return the cost. IT SHOULD NOT PRINT ANYTHING!!! Print the result from main.

CarInfo.txt Format

Year built

Car miles per gallon

CarMileage.txt Format(just numbers)

Jan. mileage

Feb. mileage

Dec. mileage

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!