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.

StudentsPrice.java 418B

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