Question: #include #include using namespace std; int main(void) { const int NUM_ASSIGNMENT = 10; const int NUM_STUDENTS = 30; int numOfAssignments = 0; int numOfStudents; int

 #include #include using namespace std; int main(void) { const int NUM_ASSIGNMENT

#include

#include

using namespace std;

int main(void) {

const int NUM_ASSIGNMENT = 10;

const int NUM_STUDENTS = 30;

int numOfAssignments = 0;

int numOfStudents;

int assignments[NUM_STUDENTS][NUM_ASSIGNMENT];

string studentNames[NUM_STUDENTS];

string assignmentNames[NUM_ASSIGNMENT];

cout

cin >> numOfStudents;

if (numOfStudents > 30) {

numOfStudents = 30;

cout

}

for (int i = 0; i

cout

cin >> studentNames[i];

}

char command_choice = ' ';

while (command_choice != 'q') {

system("CLS");

// Output ggradebook

cout

for (int i = 0; i

cout

}

cout

for (int i = 0; i

cout

if (studentNames[i].size()

cout

}

for (int j = 0; j

cout

}

cout

}

cout

cin >> command_choice;

system("CLS");

string input_name;

switch (command_choice) {

case 's':

cout

cin >> studentNames[numOfStudents];

for (int i = 0; i

cout

cin >> assignments[numOfStudents][i];

}

numOfStudents++;

break;

case 'a'://checking the condition of nnumber of assignment

if (numOfAssignments

cout

cin >> assignmentNames[numOfAssignments];

for (int i = 0; i

cout

cin >> assignments[i][numOfAssignments];

}

numOfAssignments++;

}

else {

cout

}

break;

case 'e':

cout

cin >> input_name;

//find the index of the student in the 2d array of assignments and stored it in row variable

int row, col;

for (int i = 0; i

{

if (studentNames[i] == input_name) {

row = i;

break;

}

}

cout

cin >> input_name;

//find the index of the student in the 2d array of assignments and stored it in col variable

for (int i = 0; i

{

if (assignmentNames[i] == input_name) {

col = i;

break;

}

}

int new_value;

cout

cin >> new_value;

assignments[row][col] = new_value;

break;

case'c': {int assignmentToCurve = -1;

cout

cin >> assignmentToCurve;

//adjust for arrays starting at 0;

assignmentToCurve--;

int sum = 0;

for (int i = 0; i

sum += assignments[i][assignmentToCurve];

}

float average = (float)sum / numOfStudents;

if (average

for (int i = 0; i

assignments[i][assignmentToCurve] += (70 - average);

}

cout

}

break;

}

case'q':break;

default:

cout

break;

}

}

return 0;

}

In this quest, you are going to modify quest 5 so that it saves your class roster to a file and can load from that file. 1. When you first start the program you should ask if they want to load a file or enter new information! Do not ask for a file name. The file name should be hard coded into your program! o 2. Remember that Quest 5 had you first ask for input. When the program comes up the user should have the option of loading from a file or manually input a new class. o If the user chooses to load from a file, but there is no file available, it should output a message saying as much and revert to manual input. 3. When the user chooses the quit menu item the current grade book should be saved to the file

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!