I got some of the codes but I can\'t figure the rest out, cansomeone \"HELP?\" A
ID: 3607935 • Letter: I
Question
I got some of the codes but I can't figure the rest out, cansomeone "HELP?" A 'max' point will be giving to this problem(answer.) This is a problem base on temperature "low, high,differences etc." (2D array)#include <iostream>
const int NMBROFCLMNS = 8;
const int NMBROFROWS = 24;
void processArray(int TR[][NMBROFCLMNS]);
double avgerage(int [][NMBROFCLMNS], int, int);
int high(int TR[][NMBROFCLMNS], int, int);
int low(int [][NMBROFCLMNS], int, int);
int tempDifference(int [][NMBROFCLMNS], int , int );
int main ( ){
int tempReadings [NMBROFROWS][NMBROFCLMNS] = {
{96, 94, 95,100, 115, 97, 92, 65},
{100, 92,91, 110, 115, 99, 98, 65},
{120, 91,99, 113, 115, 95, 99, 66},
{97, 99,100, 114, 115, 100, 100, 66},
{99, 100,111, 115, 115, 104, 104, 68},
{95, 130,112, 101, 115, 100, 115, 65},
{94, 90, 95,100, 105, 97, 120, 64},
{96, 94, 95,100, 115, 97, 92, 65},
{100, 92,91, 110, 115, 99, 98, 65},
{120, 91,99, 113, 115, 95, 99, 66},
{97, 99,100, 114, 115, 100, 100, 66},
{99, 100,111, 115, 115, 104, 104, 68},
{95, 130,112, 101, 115, 100, 115, 65},
{94, 90, 95,100, 105, 97, 120, 64},
{96, 94, 95,100, 115, 97, 92, 65},
{100, 92,91, 110, 115, 99, 98, 65},
{120, 91,99, 113, 115, 95, 99, 66},
{97, 99,100, 114, 115, 100, 100, 66},
{99, 100,111, 115, 115, 104, 104, 68},
{95, 130,112, 101, 115, 100, 115, 65},
{94, 90, 95,100, 105, 97, 120, 64},
{99, 100,111, 115, 115, 104, 104, 68},
{92, 93, 94,95, 96, 97, 98, 64},
{96, 94, 95,100, 115, 97, 92, 64} };
processArray(tempReadings);
return 0;
} //end main
void processArray(int temperatures[][NMBROFCLMNS])
{
//Create the required tables
//print the table heading
std::cout << "Low / High / AverageTemperature Table ";
std::cout << "Unit" <<" Low" << " High" << " AVG ";
//Iterate through each clmn of thearray and calculate column stats
for (int clmn = 0; clmn < 8; clmn++){
std::cout<< clmn << " "
<<low(temperatures,NMBROFROWS,clmn) << " "
<< high(temperatures,NMBROFROWS,clmn) << " "
<<avgerage(temperatures,NMBROFROWS,clmn) <<" ";
};
//calculate and display the tempdifference table
tempDifference(temperatures,NMBROFROWS,NMBROFCLMNS);
}
void printColumn(int theArray[][NMBROFCLMNS], int nmbrOfRows, intTheClmn){
//prints the values in the given column(TheClmn)
for (int row = 0; row < nmbrOfRows;row++)
std::cout <<theArray[row][TheClmn] << " ";
std::cout << std::endl;
}
int low(int theArray[][NMBROFCLMNS], int nmbrOfRows, intTheClmn)
{//finds the lowest value in the given column of a two-dimensionalarray
} //end low
int high(int theArray[][NMBROFCLMNS], int nmbrOfRows, intTheClmn)
{//finds the highest value in the given column of a two-dimensionalarray
} //end high
double avgerage(int theArray[][NMBROFCLMNS], int nmbrOfRows, intTheClmn)
{//finds the average of the values in the given column of atwo-dimensional array
} //end average
int tempDifference(int theArray[][NMBROFCLMNS], int nmbrOfRows, intnmbrOfClmns){
//creates a table that contains the difference between
//each computer's temperature and the room temperature
//for each time reading. Mark all differences
//greater than or equal to 50 with an asterisk.
//Formula: differnce = theArray[row][clmn] - theArray[row][7];
} //end temperature Difference
Explanation / Answer
#include #include using namespace std;const int NMBROFCLMNS = 8;const int NMBROFROWS = 24;void processArray(int TR[][NMBROFCLMNS]);double avgerage(int [][NMBROFCLMNS], int, int);int high(int TR[][NMBROFCLMNS], int, int);int low(int [][NMBROFCLMNS], int, int);int tempDifference(int [][NMBROFCLMNS], int , int );int main ( ){int tempReadings [ NMBROFROWS][NMBROFCLMNS] = {{96, 94, 95, 100, 115, 97, 92, 65},{100, 92, 91, 110, 115, 99, 98, 65},{120, 91, 99, 113, 115, 95, 99, 66},{97, 99, 100, 114, 115, 100, 100, 66},{99, 100, 111, 115, 115, 104, 104, 68},{95, 130, 112, 101, 115, 100, 115, 65},{94, 90, 95, 100, 105, 97, 120, 64},{96, 94, 95, 100, 115, 97, 92, 65},{100, 92, 91, 110, 115, 99, 98, 65},{120, 91, 99, 113, 115, 95, 99, 66},{97, 99, 100, 114, 115, 100, 100, 66},{99, 100, 111, 115, 115, 104, 104, 68},{95, 130, 112, 101, 115, 100, 115, 65},{94, 90, 95, 100, 105, 97, 120, 64},{96, 94, 95, 100, 115, 97, 92, 65},{100, 92, 91, 110, 115, 99, 98, 65},{120, 91, 99, 113, 115, 95, 99, 66},{97, 99, 100, 114, 115, 100, 100, 66},{99, 100, 111, 115, 115, 104, 104, 68},{95, 130, 112, 101, 115, 100, 115, 65},{94, 90, 95, 100, 105, 97, 120, 64},{99, 100, 111, 115, 115, 104, 104, 68},{92, 93, 94, 95, 96, 97, 98, 64},{96, 94, 95, 100, 115, 97, 92, 64} };processArray(tempReadings);return 0;} //end mainvoid processArray(int temperatures[][NMBROFCLMNS]){//Create the required tables//print the table headingstd::coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.