Question
JAVA: Some courses assign letter grades, whereas other courses assign a percentage between 0 and 100. Still others assign a pass/fail grade. Write an interface
JAVA: Some courses assign letter grades, whereas other courses assign a percentage between 0 and 100. Still others assign a pass/fail grade. Write an interface named Grade. The toPercent method returns the grade as an integer percentage between 0 and 100 percent. The toString method prints the grade in its native format (a percentage, a letter grade, or either Pass or Fail). The isPass method returns true for a passing grade, false otherwise. The includeInAverage returns true for letter and numeric grades, but false for pass/fail grades. Write three classes that implement Grade: LetterGrade, PercentageGrade, and PassFailGrade. Write a main method that fills an array with grades. For each grade, print on one line the native format, Pass or Fail (as appropriate), and the percentage (if it can be included in an average). After the list of grades, print the average grade as a percentage. Use your schools mapping between letter grades and numeric grades, if it has one. Otherwise, make up something like A+ is 95%, A is 90%, etc.
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