Question: Write a default constructor and a second constructor for the class RatingScore, as described in Exercise 9 of the previous chapter. Exercise 9 Consider a
Write a default constructor and a second constructor for the class RatingScore, as described in Exercise 9 of the previous chapter.
Exercise 9
Consider a class RatingScore that represents a numeric rating for something such as a movie. Its attributes are
- A description of what is being rated
- The maximum possible rating
- The rating
It will have methods to
- Get the rating from a user
- Return the maximum rating possible
- Return the rating
- Return a string showing the rating in a format suitable for display
a. Write a method heading for each method.
b. Write preconditions and postconditions for each method.
c. Write some Java statements that test the class.
d. Implement the class.
Step by Step Solution
3.50 Rating (163 Votes )
There are 3 Steps involved in it
public class RatingScore private String description private int maxim... View full answer
Get step-by-step solutions from verified subject matter experts
