Question: Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. You should also have

 Write a program that uses a two-dimensional array to store thehighest and lowest temperatures for each month of the year. You shouldalso have a parallel array to store the names of the 12

Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. You should also have a parallel array to store the names of the 12 months. The program should read the Months' names, and the temperatures from a given input file called temps.txt The program should output the highest and lowest temperatures for the year, and the months that correspond to those temperatures. Your program MUST use the following functions: 1. Function loadData: The function reads and stores data in the parallel array and 2D array from a text file (temps.txt) &rows) Function tempHigh: This function finds and updates the high temperature and the void loadData(ifstream &infile, string months[], int temp[] [2], int 2. corresponding month of the year. &month, int &hightemp); Function tempLow: This function finds and updates the low temperature and the corresponding void tempHigh(string months[], int temp[][2], int rows, string 3. month of the year. void tempLow(string months[], int temp[][2], int rows, string &month, int &lowtemp); Design Considerations Please use a while loop to read all lines of text from input file. Keep the input file in the same directory as your project. Remember to include the following statements to read from an input file: #include ifstream inFile; inFile.open ("temps.txt"); inFile.close()

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!