Question: Answer in C++ language please** I got stuck. How do I find the Overall Average,Overall Highest number, and the Overall Lowest Number after all of

Answer in C++ language please**

I got stuck. How do I find the Overall Average,Overall Highest number, and the Overall Lowest Number after all of this??

#include #include #include #include using namespace std;

const int ALIASFILE_LINE_COUNT =16; const float USERBONUSLEVEL = 75.09; const float USERAWARDLEVEL = 80.72; const int USERBONUS = 5; const int USERAWARD = 8; void selectionSortAsc( double list[], int length);

int main() {cout <<" project 3 template,.. ,...includes global constants for project. "<>inputFile; fileName.open(inputFile.c_str()); if(!fileName) { cout <<" \tINPUT FILE ERROR! Exiting. "; return 1; }

// 3. GET RATE - read & display alias.txt file to verify. string info1,info2,info3,info4,info5,info6,info8,info9,info10,info11,info12,info13,info14,info15,info16,info17,info18; double rate; string a; string b; const int size = 50; while ( fileName ) { if (fileName == false) cout<<"Could not open the input file"<

// read another record getline(fileName,info1); getline(fileName,info2); getline(fileName,info3); getline(fileName,info4); getline(fileName,info5); getline(fileName,info6); fileName>>a>>b>>rate; getline(fileName,info8); getline(fileName,info9); getline(fileName,info10); getline(fileName,info11); getline(fileName,info12); getline(fileName,info13); getline(fileName,info14); getline(fileName,info15); getline(fileName,info16); getline(fileName,info17); getline(fileName,info18); } // display outFile<

// 4. load the arrays with the values // declaring 2-D array of 4 rows and 7 columns

double A[4][7];

// opening files // opening files cout<<"_____________________________________________________"<>A[row][col]; col++; } row++; } double values[7];

for(int i=0; i<4; i++){

for(int j=0; j<7; j++){ values[j]=A[i][j];

}

selectionSortAsc(values,7); for(int k=0; k<7; k++){ A[i][k]=values[k];

} } for(int i=0; i<4; i++){ for(int j=0; j<7; j++) cout<

} cout<<"_____________________________________________________"<

cout<<"Average for Week "<<(i+1)<<" is: "<<(sum/7.0)<

cout<<"_____________________________________________________"<

// 5. calculate averages for each week, and all weeks

// 6. calculate total average of all four weeks // 7. find high values for each week. double high1; double high2; double high3; double high4; double low1; double low2; double low3; double low4; high1=100; high2=100; high3=95; high4=99; low1=9.8; low2=6.9; low3=6.9; low4=5.61;

cout<<" High Values "<

// 8. find low values for each week. cout<<" Low Values "<

}

// 10. update the current rate rate+=USERBONUS if(overall_avg> USERBONUSLEVEL) { rate+= USERBONUS; } if(rate>USERBONUSLEVEL&&low!=0) { rate+=USERAWARD; } // 11. update the alias file with the new rate. //12. out to screen cout <<" ___________________________________________________________ "; cout<

/// 13. close out and exit gracefully,....

cout<<" "; return 0; } // 9. sort it all out. void selectionSortAsc( double list[], int length){ int index=0, smallestIndex=0, minIndex=0; double temp; for (index = 0; index < length ; index++){ /// Step a //smallestIndex = index; for (minIndex = 0; minIndex < length-1; minIndex++) { if (list[minIndex] > list[minIndex + 1]) // smallestIndex = minIndex; /// Step b { temp = list[minIndex]; list[minIndex] = list[minIndex + 1]; list[minIndex + 1] = temp; } } } }

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!