Question: 1. Define a new Exam class that manages the exam name (string) and its score (integer). For example, an exam can have -

1. Define a new "Exam" class that manages the exam name (string) and its score (integer). For example, an exam can have - "Midterm Exam", 100 - "Final Exam", 50

The class must not provide the default constructor. It must require the exam name and score in order to initialize the Exam object. The class must provide only the following methods (no more and no less): - isPerfect method that returns true if the score is exactly 100 and false otherwise. - isPassing method that returns true if the score is equal or greater than 70 and false otherwise. - toString method must return all the exam information including the result of the exam as a string in the following format: EXAM() SCORE() RESULT(Pass/Fail) such as EXAM(Midterm Exam) SCORE(100) RESULT(Pass) EXAM(Final Exam) SCORE(50) RESULT(Fail) "Pass" means the score is greater or equal 70. "Fail" is whenever the score is below 70. - isGreater method that compares with another Exam object and return true if the score of the current Exam object is greater than the score of the other Exam object. - increment method that accepts the increment score amount (int) and increase the current score of that exam by that given amount

Important notes: - Please do not provide any other method including a method to return the score. - The class must not provide the default constructor.

Show how this Exam class being used to create objects and how these methods are being called and return proper values.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!