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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started