Question: Assume you have built a data definition class as specified below. Enhance the data definition class by adding a special purpose method that will calculate
Assume you have built a data definition class as specified below. Enhance the data definition class by adding a special purpose method that will calculate the cost to rent the movie. Cost is calculated by multipling the movie's rating by the cost multiplier. The results of the method should be available to the implementaiton class.
public class Movie { private String title; private double rating; public static double COST_MULTIPLIER = 0.90; public Movie(String title) { this.title = title; } public Movie(String title, double rating) { this(title); this.rating = rating; } public String getTitle() { return this.title; } public double getRating() { return this.rating; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
