To Do This Your Program Will Need To Read Data From The Keyboard And From Certai

To do this your program will need to read data from the keyboard and from certain text files in secondary storage, store the data in appropriate data structures using objects, sort the data, and write output data to both the screen and to secondary storage. The specific functional

3

requirements are described in section B(2). The text files that are to be used for this programming project are described in section B(3). The classes that must be used as a minimum are described in section B(4).

B 2. Program Requirements / Functionality

The Java program must

a) Be object-oriented utilising the classes described in section B (4) as a minimum. Other classes may also be needed to solve the program requirements.

b) Be menu-driven. The main menu must have the following menu items:

1. Reservations Management

2. Room Management

3. Save Data

4. Exit from Program

c) Be able to process the defined text files. The text files and their formats are described in section B (3).

Program Start Up

When the java program starts it must perform the following file related operations:

d) Read the data from the roomList.txt file into computer memory into an appropriate array of objects (see section B (3) for a description of the roomList text file and section B (4) for a description of the Room class).

e) Read the data from the reservationList.txt file into computer memory into an appropriate array of objects (see section B (3) for a description of the reservation list text file and section B (4) for a description of the Reservation class).

After processing these files the program should display the main menu identified in section B(2)(b) above.

Main Menu Item Functionality

The required functionality for each menu item is described as follows:

1. Reservation Management

When this menu option is selected the following sub-menu should be displayed.

1. New Reservation

2. Update Existing Reservation

3. Delete a Reservation

4. Exit to Main Menu

New Reservation

When this option is selected, the program should ask the user to enter data for each field of a reservation required by the Reservation class. Reserving a room should comply with the validation rules explained in section B(5).

Update Existing Reservation

When this option is selected, the program should ask the user to enter the reservation ID. The program should then show the reservation details against that reservation ID and should ask the user to enter updated information for all fields of a reservation.

4

Delete a Reservation

Upon selection of this menu item the program should ask for the reservation id. The program should check the reservation list and display the details of that reservation on screen. The program should ask the user for confirmation (“Are you sure you want to delete this reservation Y/N”). If the user chooses Y, the program should delete the reservation and should update the reservation list accordingly. Deleting a reservation should comply with the validation rules specified in section B (5).

Exit to Main Menu

Selecting this option should take the user back to the main menu (Section B (2) b).

2. Room Management

Selecting this option should display a list of options described as below.

1. Adding a New Room

2. Update Room Information

3. Delete a Room

4. Exit to Main Menu

Adding a New Room

Choosing this option will ask the user to enter all the information required by the Room class (Section B (4)) to create a new room. Once a new room is created, the program should add the room into the room list. Adding a new room should comply with the validation rules specified in section B(5).

Update Room Information

Upon selection of this option, the program should ask the user for a room number that needs to be updated. The program should also validate if a room with that number exists in the list or not. The program should ask the user to enter a valid room number if the room number does not match with any room in the room list.

Once the room number is matched, the program should display the information of that room and should ask the user to enter all the information again (except the room ID) for that particular room. The program should update the room information and should update the room list accordingly.

Delete a Room

Upon selection of this option, the program should ask the user for a room number that needs to be deleted. The program should also validate if a room with that number exists in the list or not. The program should ask the user to enter a valid room number if the room number does not match with any room in the room list.

Once the room number is matched, the program should display the information of that room and should ask the user to confirm (“Are you sure you want to delete this reservation Y/N”). Once confirmed, the program should delete that room and should update the room list accordingly.

Deleting a room should comply with the validation rules specified in section B (5).

Exit to Main Menu

Selecting this option should take the user back to the main menu (Section B (2) b).

5

3. Save Data

The program must write the room list data back to the roomList.txt file and write all reservations to the reservationList.txt file.

4. Exit Program

The program must terminate when this menu item is selected. The program should not terminate until this option is chosen. At other times the program should return to display the Main menu after completing the chosen menu option.

B 3. Text Files to be processed

The data that is to be manipulated by your Java program in this programming project is contained in the text files roomList.txt, and reservationList.txt. Examples of these files are found in the zip file for this programming project. The data within these text files will need to be read into memory by your program so that it may be manipulated to solve many aspects of the required functionality of this programming project. The text files have been created to conform to a particular format. The format for each file is described below:

File: reservationList.txt

This file contains a full record of all rooms currently reserved. Each line within the file represents a reservation from the list, and has the following format:

Reservation ID, Reservation Name, Room Number, Check-In Date, Check-Out Date, Special Requirements

where each data item is separated by a comma (,).

A brief explanation of each of these data items:

Reservation ID: a unique numeric identifier for a reservation

Reservation Name: name of the person making reservation

Room Number: the room number for which the reservation has been made

Check-In Date: the starting date of a reservation

Check-Out Date: the ending date of a reservation

Special Requirements: any special requirements provided by the customer

File: roomList.txt

This file contains a full record of all rooms. Each line within the file represents a room in the hotel/motel, and has the following format:

Room Number, Capacity, Rent

where each data item is separated by a comma (,).

A brief explanation of each of these data items:

Room Number: a unique numeric identifier for a room

Capacity: number of people the room can accommodate

Rent: rent / night for the room

When reading the text files into memory the data should be read into appropriate array(s) of objects. The classes for these objects are briefly outlined in section B(4).

6

B 4. Required Classes

To write your solution for this project it is a requirement that you write appropriate code for at least the following java Classes:

a) Room

b) Reservation

These classes are described in general terms as follows:

a) Room class: the Room class represents an individual room. The Room class needs data fields for the Room Number, capacity and rent. Implement appropriate constructors, accessors, mutators and other appropriate methods for this class based upon the general requirements of the assignment specification.

b) Reservation class: the Reservation class represents a reservation that has been made by the customers and entered by the staff. The Reservation class needs data fields for the reservation ID, reservation name, room number, check-in date, check-out date, special requirements. Implement appropriate constructors, accessors, mutators and other appropriate methods for this class based upon the general requirements of the assignment specification.

Apart from the above two classes it is quite likely that you will also need to write other classes depending upon your solution method.

B 5. Validation Rules

The program should comply with the following validation rules

1. Delete a room – when a user wants to delete a room, the program should check if the room is already reserved or not. If the room is reserved, the program should display a message to user (“The room is reserved for current time, and cannot be deleted”).

2. Delete a reservation – while deleting a reservation, the program should check if the date of that reservation has past or not. If the date has already past for any reservation, the program should display a message (“the reservation cannot be deleted as it has already past”).

3. Add a new Room – The program should validate the room number entered by the user is not already assigned to another room. In that case the program should give an error message asking the user to enter a new room number.

4. New Reservation – The program should be able to check if the room is already reserved or not, based on the room number and dates (check-in and check-out) entered by the user. The program should also check if the reservation dates for a specific room overlaps or not (e.g. the room requested is already booked/reserved in those dates).

5. Check-in and check-out dates for a new reservation has to be entered by user in (DD/MM/YYYY) format. The program should be able to tokenise the date as a day, month or year for validation.

Duepapers
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.