// // The rental class represents a customer renting a movie. // public class Rental { private Movie movie; private int daysRented; public Rental( Movie movie, int daysRented ) { this.movie = movie; this.daysRented = daysRented; } public int daysRented() { return daysRented; } public Movie movie() { return movie; } public double price() { return movie().price( daysRented ); } public int renterPoints() { int frequentRenterPoints = 1; // with a bonus for a two-day new release rental if ( movie().priceCode() == Movie.NEW_RELEASE && daysRented() > 1 ) frequentRenterPoints = frequentRenterPoints + 1; return frequentRenterPoints; } }