Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with event trace diagram for my hotel reservation class. public class Reservation { private MasterRoomList masterRoomList; private List roomList; private int roomPrice; private

Need help with event trace diagram for my hotel reservation class.

public class Reservation {

private MasterRoomList masterRoomList; private List roomList; private int roomPrice; private int numOfGuests; private Date stayStart, stayEnd; String startDate, endDate;

String pattern = "mm/dd/yyyy"; SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);

public void addRoom(Room room) {

boolean isDirty = masterRoomList.checkDirty(room); boolean isAvailable = masterRoomList.checkCapacity(room);

//check ifDirty or notDirty if (!isDirty && isAvailable) { roomList.add(room); }

}

public MasterRoomList getMasterRoomList() { return masterRoomList; }

public void setMasterRoomList(MasterRoomList masterRoomList) { this.masterRoomList = masterRoomList; }

public List getRoomList() { return roomList; }

public void setRoomList(List roomList) { this.roomList = roomList; }

public int getRoomPrice() { return roomPrice; }

public void setRoomPrice(int roomPrice) { this.roomPrice = roomPrice; }

public int getNumOfGuests() { return numOfGuests; }

public void setNumOfGuests(int numOfGuests) { this.numOfGuests = numOfGuests; }

public Date getStayStart() { return stayStart; }

public void setStayStart(Date stayStart) { this.stayStart = stayStart; this.startDate = simpleDateFormat.format(stayStart); }

public Date getStayEnd() { return stayEnd; }

public void setStayEnd(Date stayEnd) { this.stayEnd = stayEnd; this.endDate = simpleDateFormat.format(stayEnd); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is Constitution, Political System and Public Policy? In India

Answered: 1 week ago

Question

What is Environment and Ecology? Explain with examples

Answered: 1 week ago