Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

2 What advice would you give to Khalid Ahmed?

Answered: 1 week ago

Question

To find integral of sin(logx) .

Answered: 1 week ago

Question

c. How is trust demonstrated?

Answered: 1 week ago

Question

c. Will leaders rotate periodically?

Answered: 1 week ago

Question

b. Will there be one assigned leader?

Answered: 1 week ago