The class name is Exam with three private data members: exam course code (String), exam score (double) for the student, and maximum exam score maxScore (double). Write a constructor that initializes all the data members of the class from its parameters. If maxScore is less than score, then set them to zero and print a message for this change. Provide an accessor (get) method and a mutator (set) method only for the score data member. Make sure that the new score in the set method does not exceed maxScore, otherwise leave the current value of score unchanged. Define a method called addBonus() that adds a given bonus score, as input parameter, to the student's score. If the new score after adding the bonus exceeded the maximum score, then set score to maxScore. Define a method called percentage() that returns the exam percentage out of 100. Define a method called displayExamDetails() to display on the screer"xam details as in the following sample:

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter11: More Object-oriented Programming Concepts
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question
JAVA PROGRAM!
Part (1) Define a class with the following specification:
The class name is Exam with three private data members: exam course code (String), exam score (double) for the student,
and maximum exam score maxScore (double).
Write a constructor that initializes all the data members of the class from its parameters. If maxScore is less than score,
then set them to zero and print a message for this change.
Provide an accessor (get) method and a mutator (set) method only for the score data member. Make sure that the new
score in the set method does not exceed maxScore, otherwise leave the current value of score unchanged.
Define a method called addBonus() that adds a given bonus score, as input parameter, to the student's score. If the new
score after adding the bonus exceeded the maximum score, then set score to maxScore.
Define a method called percentage() that returns the exam percentage out of 100.
Define a method called displayExamDetails() to display on the screer"kam details as in the following sample:
a.
b.
C.
d.
e.
f.
Code:
ITCS113
Score:
53.5
Max Score:
60.0
Percentage:
89.167%
Transcribed Image Text:Part (1) Define a class with the following specification: The class name is Exam with three private data members: exam course code (String), exam score (double) for the student, and maximum exam score maxScore (double). Write a constructor that initializes all the data members of the class from its parameters. If maxScore is less than score, then set them to zero and print a message for this change. Provide an accessor (get) method and a mutator (set) method only for the score data member. Make sure that the new score in the set method does not exceed maxScore, otherwise leave the current value of score unchanged. Define a method called addBonus() that adds a given bonus score, as input parameter, to the student's score. If the new score after adding the bonus exceeded the maximum score, then set score to maxScore. Define a method called percentage() that returns the exam percentage out of 100. Define a method called displayExamDetails() to display on the screer"kam details as in the following sample: a. b. C. d. e. f. Code: ITCS113 Score: 53.5 Max Score: 60.0 Percentage: 89.167%
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,