getBill has one parameter, an integer value representing a room number, and returns an
integer value representing the bill in pounds for the occupier in that room. The constant
values in the Hotel class define the appropriate values to use when computing the bill.
Here is how to compute the bill:
(a) Let total initially be zero.
(B) Let lengthOfStay be the number of nights the occupier has stayed at the hotel.
© Let numInGroup be the number of people occupying the room.
(d) If the room has a sea view, increment total by the lengthOfStay multiplied by the
SEAVIEW SUPPLEMENT.
(e) If there is only one person in the group occupying the room, increment total by the
lengthOfStay multiplied by SINGLE OCCUPIER SUPPLEMENT.
(f) Increment total by the lengthOfStay multiplied by the ROOM PRICE multiplied by
the numInGroup.
(g) Increment total by the number of dinners eaten by the occupiers multiplied by the
DINNER PRICE.
(h) Return the total.
/** get bill method to calculate the final bill of one room/group of customers **/
public double getBill(int roomnum)
{
if(rooms[roomnum] != null)
{
double bill = rooms[roomnum].getNumberOfDinners() * dinnerPrice + rooms[roomnum].getLengthOfStay() * roomPrice;
return bill;
}
else
{
return 0;
}
}
my code is completely wrong.