Additional Method: Count Number of Times a Grade Appears

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!

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

1 Like

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

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

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