You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Rental.java 539B

1234567891011121314151617181920212223242526
  1. public class Rental {
  2. private final Movie movie;
  3. private final int daysRented;
  4. public Rental( Movie movie, int daysRented ) {
  5. this.movie = movie;
  6. this.daysRented = daysRented;
  7. }
  8. public Movie getMovie() {
  9. return movie;
  10. }
  11. public int getDaysRented() {
  12. return daysRented;
  13. }
  14. public double calculateFee () {
  15. return getMovie().calculateFee(getDaysRented());
  16. }
  17. public int calculateBonus (){
  18. return getMovie().calculateBonus(getDaysRented());
  19. }
  20. }