Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this project, you are required to write a project for a hotel management system: Phase 2 will be as follows: Write a java program
In this project, you are required to write a project for a hotel management system: Phase will be as follows:
Write a java program that keeps displaying the main menu containing the following options:
A Show All Rooms
B Show Available rooms isOccupied false
C Change room details
D Search by room type
E Search by capacity
F Sort and display rooms by pricePerNight ascending using your own sort method.
G Reserve a specific Room, set isOccupiedtrue, and input the customer first and last name in an array.
H Read room details from a file, update rooms based on the file. The format of each line in the file
should be as follows: roomNo RoomType isOccupied Capacity pricePerNight. For example:
Standard false
I. Save rooms data to file No need to store floor number as it can be extracted from room number The
format of each line in the file should be similar to the format of the reading file.
J Quit
Class name: Room.java.
a A room has the following details
Integer Room number
Integer Floor number from to
String Room Type Standard Family, Suite
Boolean isOccupied
Integer capacity
Double pricePerNight
Rooms on the first rooms to are standard, rooms: to are Family, and rooms: to are
Suite. All rooms have isOccupied false, and capacity The price per Night should be a random
integer between and stored as a double Room numbers are numbered from to with
floor number to with floor number to with floor number to with
floor number and to with floor number
Array of Customer name staying in the room array size is : the first element is the first name and the
second element is the last name
Customer name is present only if isOccupied true for a specific room.
b Write appropriate setters and getters for the room class, and toString method.
c Write appropriate methods to validate correct room numbers, room types, and capacities assume valid capacity
is from to
Class name: RoomManagement.java: Room Management System which includes a one dimesional array of rooms of
the Room Class array size The Room management system allows the behavior of the menu described above.
The Room management system allows the following behavior:
a Show All Rooms
b Show Available rooms isOccupied false
c Change room details: to allow to change the following room details at the same time: room type, isOccupied,
capacity, pricePernight. The user must first enter the room number; after that, the room details are entered
from the keyboard.
d Search by room type
e Search by capacity
f Sort and display rooms by pricePerNight ascending. Do not use any java ready methods for sorting. You must
write your own sort method.
g Reserve a specific Room, set isOccupiedtrue, and input from keyboard the customer name to stay in the
room. For each customer name, use a String array of size The first element of the array is the first name of
the customer, while the second element of the array is the last name of the customer.
h Read room details from a file, update rooms based on the file. The format of each line in the file should be as
follows: roomNo RoomType isOccupied Capacity pricePerNight. For example:
Standard false
i Save rooms data to file No need to store floor number as it can be extracted from room number The format
of each line in the file should be similar to the format of the reading file.
Create a Driver class that allow shows the menu above and creates a RoomManagement object and when selecting
Room Management System allows the above behavior. All keyboard input should occur in the driver class.
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