Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

eSsment est SQL Edito Run Live Coding Database Window HandsUn Help

Customersooin9 ,
DLuxuryResortjava Resortjava 3
Testerjava DQueuejava Solutionjava Stackjava
this.totalStayCost totalstayCost Testerjavwa
2
43
To Trainee
public void generateBookingID () {
counter+
String bookId;
if(roomType.equalsIgnoreCase(
bookTd="G"+counter: GoldD
4
custBooking.setCustBookingID(bookId) ;
else if(roomType.equalsIgnoreCase("Deluxe"))
bookid=D ounter;
custBooking.setCustBookingID(bookId);
2
sel bookId= R+Counters
custBooking. setCustBookingID (bookId);

/Lmplement your logic here


52

WTo Trainee

Writable Senart insert 1:1


53
IITo Trainee
public Integer identifyDiscountPercentage() {
6
int discountPercentage=0;
if(custBooking-getMembershipType ().equals("Gold")){
if(this. roomType.equalsIgnorecase("Executive"))
discountPercentage=10;
else
if(this. roomType.equalsIgnoreCase("Deluxe")){
discountPercentage=8;

else if(custBooking-getMembershipType().equals("Platinum")){
discountPercentage-15;

elsediscountPercentage=0;
logic here
52
// Implement your

85
return statement accordingly
84
5
1/Change the
return discountPercentage;

Writable Smart insert


//To Trainee
18 public Integer identifyLuxuryServicesCost()
19 int luxuryServicesCost-®;
if(this.reqLuxuryServicesArr==null){
luxuryServicesCost-0;

elsel
for(String s: regLuxuryServicesArr){
for(int i-0; i <luxuryServicesArr.length;it+)
if(s.equalsIgnoreCase(luxuryservicesArr[i]))
luxuryservicesCost+=luxuryservicescostArr[i]s

I/Implement your logic here

11Change the
return statement accordingly
return IuxuryServicesCosts

Writable Semart inse 61:85


DCustomerBooking. java LuxuryResortjava Resortjava Testerjava Queuejava Solution,java Stackjavs Testerjava
I t o Trainee
public void calculateTotalStayCost() (
int roomCostPerDay-e, stayingCost-8
Integer discountPercentage-0, luxuryServicesCost-0;
fthisgetCustBoking().validateCusthembership () 8& this.getcustBooking ()-getStayDuration() >0){
boolean roomoun omTypeArr().length;1trRoomTypeArr()[i1))
TOr 1getOomIypeArr().length;it+){
at(this-getRoomIype().equalsignoreCase(getRoom TypeArrO[i])){
ooLOsterbaygetkoomcostArrOl]s
ooroundmtrue;
break;

if(roomFound=-false)
roomcostPerbay
if(roomcostperDay-1){
discountPercentage identifyDiscountPercentage()
luxuryServicescost identityLuxuryservicescostOs
stayingcost-roomCostPerbay + luxuyservicescost
stayingCost(this.viewype.egualsake tayanCost5 avns
double totalStaycost stayingcostthis.8etustooKngO-getstayaon
totalStaycost totalStaycosttotalStaycost (discountPercentage/100,)
this.setTotalStaycost(totalStayCost);
this -generateBookingID();
Nritable Smart insert 61:5
Source Ketactor Navigate >ercn roect
dit
P : l
LuxuryResort.java Resort.java 9 Testerjava DQueuejava Solutionjava Stackjava Testerj
CustomerBookingjava uxury>erviesLUSL UenLyLURury>erv4LeSLUS U
stayingcostnoomcostPerbay + luxuryServicesCost;
?stayingCost+500:stayingfost;
stayingCost (this.viewType.equals ("lake"))
double totalStayCost stayingCost this.getCustBooking ()-getstayDuration ();
totalStayCost totalstaycost totalstayCost "(discountPercenta8e/100.8);
this.setrotalstaycost(totalstayCost);
b this.generateBookingID();
57

59
sethis. getCustBooking ().setCustBookingID(
this.setTotalStayCost(-1.e);
"NA")

elsethis.getcustBooking (). setCustBooking ID ("NA");


this.setTotalStayCost(-1.0);

//Implement your logic here

You might also like