Additional Method: Count Number of Times a Grade Appears


#1

Hi everyone,

I just completed Grade Analyzer project with additional highest and lowest grade methods.

However, I was thinking about how to print out statements like “There are 2 people who received 80”, basically just count number of times a grade appears

It would be great if you can throw me some ideas how the method should look like, pseudo code would be great :slight_smile:

Thank you so much!


#2

the simplest psuedo code would be to make an integer variable named highestGradeOccurence, then loop over the grades and each time the grade equals the highest grade, you can simply increase highestGradeOccurence by one


#3

Hmm what if I want to print all the grades and their occurrence as a list?


#4

This is exactly what programming is about, if i tell you, a valuable learning opportunity goes away. How would you go about doing this?


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.