Question: write in C language Write a program that asks three students to enter grades they received in their courses and then prints the GPA of
Write a program that asks three students to enter grades they received in their courses and then prints the GPA of each student. A student has taken an indefinite number of courses; they enter the sentinel when they're done entering their grades. The courses have the same number of credits. The grade scale is (4,3,2,1,0), which corresponds to (A,B,C,D,F), respectively. Print the GPA as a floating-point value. If the user enters an invalid grade, print an error message and prompt for the same course number again. In the sample below, Student I enters -10 for Class 4, the next prompt repeats Class 4. In this program, it is known that there will be three students and each student has an indefinite number of grades. What's the suitable loop structure for this program? Student 1 Class 1 : 4 Class 2:3 Class 3: 2 Class 4: -10 >>> Invalid grade! Class 4: 1 Class 5: -1 Student 2 Class 1: 3 Class 2: -1 Student 3 Class 1: 3 Class 2: 4 Class 3: 12 >>> Invalid grade! class 3: 0 Class 4: -1 Student 1 GPA: 2.50 Student 2 GPA: 3.00 Student 3 GPA: 2.33
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
