Case Study Problem Idea Class Grades
Case Study Problem Idea Class Grades
class of students. The program should take input from the user, including the number of students in the
class, the weightage of each assignment, and the scores obtained by each student for each assignment.
The program should then calculate the final grades for each student and output them to the user.
The program should take the following inputs from the user:
1 array (one-dimensional or multi-dimensional) to store the scores obtained by each student for
each assignment
2 loop structures (1 of which is a nested loop) to iterate through the array and calculate the final
grade for each student
2 functions: one to calculate the final grade for a single student based on their scores, and
another to calculate the class average grade.
Once the program has calculated the final grades for each student, it should output the following
information:
The program should make use of input/output constructs, mathematical operators, string manipulation,
decision-making structures, loop structures, and functions in order to solve the problem.
#include <iostream>
#include <cstdlib>
float assignmentTotal = 0;
assignmentTotal += assignmentScores[i];
return finalGrade;
int main() {
int numStudents;
float assignmentWeight;
float assignmentScores[10][5];
float midtermScores[10];
float finalScores[10];
float finalGrades[10];
float classAvg = 0;
// Get input from the user
cout << "Enter the weightage of each assignment (as a percentage): ";
cout << "Enter the assignment scores for student " << i + 1 << " (out of 10): ";
cout << "Enter the midterm score for student " << i + 1 << ": ";
cout << "Enter the final score for student " << i + 1 << ": ";
classAvg += finalGrades[i];
cout << "Final grade for student " << i + 1 << " is " << finalGrades[i] << endl;
cout << "Class average grade is " << classAvg << endl;
return 0;