Create a Test class with the following features: Has fields for id, maximum score and score obtained
Fantastic news! We've Found the answer you've been seeking!
Question:
Create a Test class with the following features:
- Has fields for id, maximum score and score obtained
- should assign automatically unique id for each object starting from 1 (Hint: Think of static member)
- Has getter and setter methods for all the fields
- Has possible constructor to create objects with and without given values
- Has methods to get percentage score and letter grade. The letter grade is decided as follows:
- 'A' for score 90% or above
- 'B' 80% or above but less than 90%
- 'C' 70% or above but less than 80%
- 'D' 60% or above but less than 70%
- 'F' otherwise
- Should have equals method to compare two test objects and they will be same if id of one test is same as the other
- Should have toString method to return the complete information about the test
Create a MainClass with the following methods.
- Create a static methodcreateTestt(), which should accept the information about the test from the user. After that it should create and return the test object.
- Create a static methodprintTestt(), which should accept test object as a parameter and print all the information about the test.
- Create a main method using the provided methods that should continue to accept the information about the test from the user and print the details of the testt.
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date: