1 public class Movie implements PriceParams 2 { 3 private String _title; 4 private Price _price; 5 6 public Movie(String title, int priceCode) 7 { 8 _title = title; 9 _price = Price.getInstance(priceCode); 10 } 11 12 public int getPriceCode() 13 { 14 return _price.getPriceCode(); 15 } 16 17 public void setPriceCode(int priceCode) 18 { 19 _price = Price.getInstance(priceCode); 20 } 21 22 public String getTitle() 23 { 24 return _title; 25 } 26 27 public double getCharge(int daysRented) 28 { 29 return _price.getCharge(daysRented); 30 } 31 32 public int getFrequentRenterPoints(int daysRented) 33 { 34 return _price.getFrequentRenterPoints(daysRented); 35 } 36 }