Question
Please complete the below C++ code as instructions: Most of the program is written. However, you need to create the functionality of taking the whole
Please complete the below C++ code as instructions:
Most of the program is written. However, you need to create the functionality of taking the whole gradebook and finding the average across all students (rows) for each of the assignments (columns).
Hint: if you have nested loops to traverse the gradebook, you want to go through each ROW (student) before going onto the next COLUMN (assignments). Usually you've done it the other way around, but since we are averaging each column, the order needs to be different.
#include
#include
//Global constants... const int MAX_EXERCISES = 10; const int MAX_STUDENTS = 5;
//Function prototypes... vector < vector
//Main program... int main() { int exercises=0; int students=0; vector < vector
exercises = getNum("exercises",MAX_EXERCISES); students = getNum("students",MAX_STUDENTS); gradebook = fillGradebook(students,exercises); avgGrade = averageAssignment( gradebook ); // <-- IMPLEMENT FUNCTION FOR THIS display(avgGrade);
return 0; }
vector < vector
for(int student=0; student < students; student++ ) { cout<<"Enter student "<<(student+1)<<"'s " <
int getNum(string name,int maximum) { int count = 0; do { cout<<"How many "<
void display(vector
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