Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Create a datafile that contains the names of 50 cities andtheir respective ga

ID: 3611128 • Letter: 1

Question

1. Create a datafile that contains the names of 50 cities andtheir respective gas prices. You can look these up online, uselocal prices, and/or make up a few (as long as your prices arereasonable!). Your city names should be a single string with nospaces in them to simplify the reading process.

2. Write a program reads the city names and respective gasprices into 2 single-subscripted arrays in your program - one oftype string, the other of type double. (We would call these"parallel arrays" - each corresponding location shows the city nameand gas price for each city). Your program should do thefollowing:

a. Find and display the average gas price.

b. Find and display the highest gas price, along with a list ofall cities at that gas price.

c. Find and display the lowest gas price, along with a list ofall cities at that gas price.

Your program must use at least 2 well-defined functions. Youcan, if you wish, use more. Direct all output to the consolewindow. All output should be well labeled and formatted.

In all of your programs, you must remember the following:

· Include documentation at the beginning of yourprogram.

· Include your first and last name as the first line ofall of your program outputs.

· Use appropriate, meaningful identifier names for allvariables in your program.

· Declare constant variables for any "numeric constants"in your code.

Explanation / Answer

please rate - thanks #include #include using namespace std; double findaverage(double[]); void findcity(string [],double [], double ); double findhigh(double[]); double findlow(double[]); #define length 50 int main() {double price[50],average,highest,lowest; string city[50]; int i; ifstream in; in.open("input.txt");          //open file   if(in.fail())            //is it ok?        { cout>price[i]; average=findaverage(price); lowest=findlow(price); highest=findhigh(price); findcity(city,price, lowest); findcity(city,price, highest); system ("pause"); return 0; } double findhigh(double price[]) {double max; int i; max=price[0]; for(i=1;imax)        max=price[i]; return max; } double findlow(double price[]) {double min; int i; min=price[0]; for(i=1;i