Question: Write a program that calculates the average grade for each of a number of students based on their input grades. Your program should prompt the

Write a program that calculates the average grade for each of a number of students based on their input grades. Your program should prompt the user to enter the number of students and the number of grades per student. Then, it should allow the user to input the grades for each student. Finally, your program will calculate and display the average grade for each student.
Use a 2D array to store grades for each student, and make sure your code handles both integer and floating point grades.
Here's an example run (user input in <>):
Enter the number of students: <3>
Enter the number of grades per student: <4>
Enter grades for Student 1:
Grade 1: <85>
Grade 2: <90>
Grade 3: <88>
Grade 4: <92>
Enter grades for Student 2:
Grade 1: <75>
Grade 2: <80>
Grade 3: <78>
Grade 4: <82>
Enter grades for Student 3:
Grade 1: <92>
Grade 2: <88>
Grade 3: <90>
Grade 4: <95>
Average grades per student:
Student 1: 88.75
Student 2: 78.75
Student 3: 91.25

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 Programming Questions!