Question
Create a class called OrdinaryWizardingLevels that keeps track of scores for OWLs (Ordinary Wizarding Levels) at Hogwarts. The program should count the number of grades
Create a class called OrdinaryWizardingLevels that keeps track of scores for OWLs (Ordinary Wizarding Levels) at Hogwarts. The program should count the number of grades for each category (O, E, A, P, D, T) as well as calculate the class average based on all the scores entered. Scores entered should only be whole numbers, never decimals. Scores should continue to be entered, using the Scanner class, until a negative value is inputted (which will serve as a sentinel value and should not be included in any way in your calculations). The grading system is as follows: O (Outstanding) 90-100, E (Exceeds Expectations) between 80 and under 90, A (Acceptable) from 65 to under 80, P (Poor) from 50 to under 65, D (Dreadful) between 40 and 50 (non-inclusive), and T (Troll) below 50. All in all, your program should output a nice table with the number of students that earned grades in each category, as well as the class average, printed to three decimal places (HINT: use printf), neatly beneath it. Include 3 sample runs of your program with different values to show that it works. Show your code and your output in screenshots. Below is one sample run of your program: This program will tell you the total number of students earning an O, E, A, P, D and T in your Hogwarts class and the average score to three decimal places. Type in each score. Type in a negative number to signify that you are done entering in data. 12 100 9 97 26 58 -1 2: Outstanding 0: Exceeding 0: Acceptable 1: Poor 0: Dreadful 3: Troll Out of your 6 students, the average score is 50.333% which is Poor.
Use Java to Solve
Do not use the scanner function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started