Unit 3 - Using Algorithm and Flowchart in programming

Posted on Friday, May 7, 2010 by B[H] | 0 comments
Labels:

Class average Algorithm

Problem: Calculate and report the grade-point average for a class.

Discussion: The average grade equals the sum of all grades divided by number of students. We need a loop to read and then add (accumulate) the grades for each student in the class. Inside the loop, we also need to total (count) the number of students in the class.

Input: Students grades

Processing: Find the sum of the grades; count the number of students; calculate average grades = sum of grades / number of students.

Output: Average grade.

No comments:

Post a Comment