Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use JAVA only Write a class named Grade. This class should keep track of a student's grade. The grade itself will be stored as

Please use JAVA only

Write a class named Grade. This class should keep track of a student's grade. The grade itself will be stored as a floating point number, but it should also be able to produce a corresponding letter grade. You may not use any import statements. Any data elements should be declared private, although this will not be graded. If you think it is necessary you may include helper methods of your own. The class should implement the following public methods:

  • public Grade() the constructor will initialize the grade to 100.0.
  • public Grade(double grade) the constructor will initialize the grade to the given value. If a grade less than zero is passed in, then the value should default to zero instead.
  • double getGrade() this getter method will return the student's grade.
  • void setGrade(double grade) this setter method will set a new value of the grade. If a grade less than zero is passed in, then the value should be ignored and the original kept instead.
  • public String toString() returns the letter grade corresponding to the numerical grade. The scale is: "A" for 90 and above; "B" for grades 80 and above but below A; "C" for grades 70 and above but below B; "D" for 60 and above but below C; "F" for all other grades.

All method signatures should match the ones shown exactly.

Please make sure that it passes the following: https://repl.it/@micky123/NeglectedWoozyTruetype

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

ISBN: 3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago

Question

5. Describe the relationship between history and identity.

Answered: 1 week ago