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.

RegularPrice.java 419B

123456789101112131415161718
  1. public class RegularPrice implements Price {
  2. @Override
  3. public int getPriceCode() {
  4. return Movie.REGULAR;
  5. }
  6. @Override
  7. public double getFee(int daysRented) {
  8. double thisAmount = 2;
  9. if(daysRented > 2) {
  10. thisAmount += (daysRented -2) * 1.5;
  11. }
  12. return thisAmount;
  13. }
  14. @Override
  15. public int getBonus( int daysRented ) {
  16. return 1;
  17. }
  18. }