Dr. Ely has a stack of graded exams on his desk. All grades are integers with the lowest possible grade being a 0 and the highest possible grade being 100. He would like to know if more students got a grade in the 'B' range or a grade in the C range on the exam (the lowest score for a C is a 70, the lowest for a B is an 80, and the lowest for an A is 90. There is no such thing as a C- or C+, these scores are all just a C grade. The B grades work in a similar fashion).

Write a program that allows Dr. Ely to input each exam score into the program, one at a time, until Dr. Ely terminates input by typing in a -1. The program should correctly print one of the following three messages:

  • There were more 'B' grades than C grades
  • There were more 'C' grades than B grades
  • There were an equal number of 'B' and C grades

Examples:

INPUT OUTPUT
35 , 90 , 100 , 83 , 2 , 62 , -1 There were more 'B' grades than 'C' grades
99 , 34 , 99 , -1 There were an equal number of 'B' and 'C' grades
79 , 30 , 85 , 74 , 0 , 74 , 81 , 55, -1 There were more 'C' grades than 'B' grades
-1 There were an equal number of 'B' and 'C' grades
44, 80 , 89, 72, 100, 80 -1 There were more 'B' grades than C grades

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.