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 = 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; }
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