
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Develop a class average program that processes grades for an arbitrary number of students each time it is run. Also draw the Flow chart for this problem.
Class average problem pseudocode algorithm with sentinel-controlled repetition
1 Initialize total to zero 2 Initialize counter to zero 3 4 Prompt the user to enter the first grade 5 Input the first grade (possibly the sentinel) 6 7 While the user has not yet entered the sentinel 8 Add this grade into the running total 9 Add one to the grade counter 10 Prompt the user to enter the next grade 11 Input the next grade (possibly the sentinel) 12 13 If the counter is not equal to zero 14 Set the average to the total divided by the counter 15 Print the total of the grades for all students in the class 16 Print the class average 17 else 18 Print "No grades were entered"