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(
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
Get step-by-step solutions from verified subject matter experts
