Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in C! that asks three students to enter grades they received in their courses and then prints the GPA of each student.

Write a program in C! 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 courseshave the same number of credits. The gradescale 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 1 enters -10 for Class 4, the next prompt repeats Class 4.

image text in transcribedIn this program, it is known that there will be three students and each student has an indefinite number of grades. Whats 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

If C(x, y) = 600 - 4xy + 10x2y, find C/x and C/y.

Answered: 1 week ago