Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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.
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