Question: Then create a C program called gpaYourInitials.c that you will save in your cop 2 2 2 0 folder. The program is designed to determine

Then create a C program called gpaYourInitials.c that you will save in your cop2220 folder. The program is designed to determine the average gpa from a set of gpas as well as the highest and lowest gpas in the set. It will also keep track of the students who had the highest and lowest gpas. The algorithm for the program is as follows (Pay attention to indentation):Declare integer variables named studentID, lowStudentID, highStudentID, numStudents.Declare float variables named gpa, lowGPA, highGPA, avgGPA, totGPA.Set numStudents, lowStudentID, highStudentID to 0. Set highGPA to -1 and lowGPA to 10. Set totGPA to 0. Print a message asking the user for a student ID or a non- positive number to quit entering data. Get the ID from the user and store it in studentID. While the studentID is bigger than 0 do the following: Print a message asking the user for a gpa between 0 and 4 inclusive of 0 and 4. Get the gpa from the user and store it in the gpa variable. If the gpa is between 0 and 4(inclusive of both endpoints), do the following: Add 1 to the numStudents variable. Add the gpa to the totGPA variable. If the gpa is bigger than the highGPA then:Page 1 Store the gpa in highGPA Store the studentID in highStudentID If the gpa is smaller than the lowGPA then: Store the gpa in lowGPA Store the studentID in lowStudentID(Note that the previous two if statements DON'T have else clauses. They are two separate if statements.) Else (This is the else for the if that checks gpa between 0 and 4) Print a message saying that the gpa is out of range and that that data will be skipped. Print a message asking the user for another student ID or a non-positive number to quit entering data.Get the ID from the user and store it in studentID. [The following is below the while loop and NOT inside it.] If numStudents is equal to 0 do: Print a message stating that no data was entered. Else: Calculate the average gpa by dividing the totGPA by numStudents. Print the number of students with a nice message. Print the average gpa with a nice message and with 2 decimal places. Print the student ID that had the highest gpa with a nice message. Print the highest gpa with a nice message and with 2 decimal places. Print the student ID that had the lowest gpa with a nice message. Print the lowest gpa with a nice message and with 2 decimal places.

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