Answered step by step
Verified Expert Solution
Question
1 Approved Answer
room.java: Problem Statement (Summary): You are going to develop a simple application for Hotels. Hotel is, actually, a Building, with some extra features. Each hotel
room.java:
Problem Statement (Summary): You are going to develop a simple application for Hotels. Hotel is, actually, a Building, with some extra features. Each hotel as a couple of rooms. Each room, has some features, including its own calendar, to keep its reservation records. To implement and test this system, you must create six Java classes as follows: Class Room (27 marks): Open the Java file Room.java that is provided. The purpose of this class is to keep the record of each room of a given hotel. Later on, you must use this class inside the Hotel class. Complete this Java class using the following specifications: . O Room type O O First define an enum, named RoomType, with four possible values: (2 marks) SINGLE, DOUBLE, STUDIO, SUITE Every room instance object has (8 marks) (Hint: use enum you defined for the type of this variable.) O price per night room size floor number room number description vacancy status O ArrayList of all its reservations A constructor with six parameters, room pe, price, size, room number, floor, and description. Note that you must also initialize the vacancy status and the list of reservations. (3 marks) Getter methods for the vacancy status, room number, price, and list of the reservations. (2 marks) A setter method for the price. (1 mark) O O . A method, reserve, which gives start date (inclusive), end date (exclusive), and guest, and will reserve the room. Note that the room availability should be checked in this method. If it is available, then it reserves the room and returns the reservation number, and otherwise returns zero. (3 marks) A method, cancel, which gives a reservation number and will cancel that reservation. (2 marks) Two methods, checkin and checkout, to set the vacancy type of the room, accordingly. (2 marks) A method, status, which returns a string including the list of all the reservations of the room, with a format like example below. (2 marks) Reservation list of room number 102: Vacant. Reservation Number: 10001. From: 2021-03-21 To: 2021-03-24, Guest: Joe Uncle, $50.5 per night. Reservation Number: 10002. From: 2021-04-02 To: 2021-04-04, Guest: Lu Brother, $52.0 per night. Override the toString method, such that it returns a string including the room information, with the format like example below. The last part of the following example is the room description. (2 marks) SINGLE, price=$35.5, Size=200.0, Number=101, Floor=1, Single Room without view public class Room { } Problem Statement (Summary): You are going to develop a simple application for Hotels. Hotel is, actually, a Building, with some extra features. Each hotel as a couple of rooms. Each room, has some features, including its own calendar, to keep its reservation records. To implement and test this system, you must create six Java classes as follows: Class Room (27 marks): Open the Java file Room.java that is provided. The purpose of this class is to keep the record of each room of a given hotel. Later on, you must use this class inside the Hotel class. Complete this Java class using the following specifications: . O Room type O O First define an enum, named RoomType, with four possible values: (2 marks) SINGLE, DOUBLE, STUDIO, SUITE Every room instance object has (8 marks) (Hint: use enum you defined for the type of this variable.) O price per night room size floor number room number description vacancy status O ArrayList of all its reservations A constructor with six parameters, room pe, price, size, room number, floor, and description. Note that you must also initialize the vacancy status and the list of reservations. (3 marks) Getter methods for the vacancy status, room number, price, and list of the reservations. (2 marks) A setter method for the price. (1 mark) O O . A method, reserve, which gives start date (inclusive), end date (exclusive), and guest, and will reserve the room. Note that the room availability should be checked in this method. If it is available, then it reserves the room and returns the reservation number, and otherwise returns zero. (3 marks) A method, cancel, which gives a reservation number and will cancel that reservation. (2 marks) Two methods, checkin and checkout, to set the vacancy type of the room, accordingly. (2 marks) A method, status, which returns a string including the list of all the reservations of the room, with a format like example below. (2 marks) Reservation list of room number 102: Vacant. Reservation Number: 10001. From: 2021-03-21 To: 2021-03-24, Guest: Joe Uncle, $50.5 per night. Reservation Number: 10002. From: 2021-04-02 To: 2021-04-04, Guest: Lu Brother, $52.0 per night. Override the toString method, such that it returns a string including the room information, with the format like example below. The last part of the following example is the room description. (2 marks) SINGLE, price=$35.5, Size=200.0, Number=101, Floor=1, Single Room without view public class Room { }Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started