CS1073/Submissions/CS1073 As9/Zip/2/ElitePackageBooking.java
2022-10-07 00:22:46 -03:00

24 lines
598 B
Java

public class ElitePackageBooking extends TouristPackageBooking{
ElitePackageBooking(long aLaCarteMeals, long spaVisits) {
super(aLaCarteMeals, spaVisits);
}
@Override
double getTotalCost() {
double aLaCarteMealsCost;
if (aLaCarteMeals <= 3) {
aLaCarteMealsCost = 0.00;
}
else {
aLaCarteMealsCost = (aLaCarteMeals -3) * 35.00;
}
return ((super.basePrice+775) + (aLaCarteMealsCost) + (spaVisits*75));
}
@Override
int getBuildingNumber() {
return 1;
}
}