The purpose of the following program is to calculate the fee of the rental.
Code: Select all
Float calcRentalFee(Tape[] tapes, Customer customer){
float total = 0;
for(int i = 0; i <tapes.length; i++){
total += tapes[i].price;
}
if (tapes.length> 10){
total *= .8;
} else if(tapes.length> 5){
total *= .9;
}
if(customer.isPremium()){
total *= .9;
}
return total;
}