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

34 lines
1.1 KiB
Java

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
public class ResortBooking {
String name;
TouristPackageBooking tTourist;
ElitePackageBooking eTourist;
NumberFormat cf = NumberFormat.getCurrencyInstance(Locale.CANADA);
ResortBooking(TouristPackageBooking touristIn, String name) {
tTourist = touristIn;
this.name = name;
}
ResortBooking(ElitePackageBooking touristIn, String name) {
eTourist = touristIn;
this.name = name;
}
String getBuildingNumber(TouristPackageBooking tourist) {
return "Building Number: " + tourist.getBuildingNumber();
}
String getBuildingNumber(ElitePackageBooking tourist) {
return "Building Number: " + tourist.getBuildingNumber();
}
String getTotalCost(TouristPackageBooking tourist) {
return "Total price for this package: " + cf.format(tourist.getTotalCost());
}
String getTotalCost(ElitePackageBooking tourist) {
return "Total price for this package: " + cf.format(tourist.getTotalCost());
}
}