Answered step by step
Verified Expert Solution
Link Copied!

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:

  1. Has fields for id, maximum score and score obtained
  2. should assign automatically unique id for each object starting from 1 (Hint: Think of static member)
  3. Has getter and setter methods for all the fields
  4. Has possible constructor to create objects with and without given values
  5. Has methods to get percentage score and letter grade. The letter grade is decided as follows:
    1. 'A' for score 90% or above
    2. 'B' 80% or above but less than 90%
    3. 'C' 70% or above but less than 80%
    4. 'D' 60% or above but less than 70%
    5. 'F' otherwise
  6. Should have equals method to compare two test objects and they will be same if id of one test is same as the other
  7. Should have toString method to return the complete information about the test

Create a MainClass with the following methods.

  1. 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.
  2. Create a static methodprintTestt(), which should accept test object as a parameter and print all the information about the test.
  3. 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

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What is a shared lock? What is an exclusive lock?

Answered: 1 week ago

Question

What are relationships called in UML?

Answered: 1 week ago