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 cop 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 Set highGPA to and lowGPA to Set totGPA to 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 do the following: Print a message asking the user for a gpa between and inclusive of and Get the gpa from the user and store it in the gpa variable. If the gpa is between and inclusive of both endpoints do the following: Add to the numStudents variable. Add the gpa to the totGPA variable. If the gpa is bigger than the highGPA then:Page 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 lowStudentIDNote 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 and 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 nonpositive 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 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 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 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 decimal places.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
