In this assignment you will create a (somewhat limited) Java text-based
interface to your Postgres hotel reservations database. In particular
you will allow creation of a reservation (including assignment of rooms),
canceling a reservation, and displaying some helpful queries.
Follow these steps as you complete this assignment:
- Create a main menu
- that will include the following options:
- Make a Reservation
- Cancel a Reservation
- List Current/Upcoming Reservations
- Display Revenue for Current Month
- Exit Program
The menu should be displayed when the program is run and should be placed in
a loop to repeat until the user chooses to exit the program.
- Make a Reservation
- To make a reservation you'll need to:
- Get the next reservation id using nextval.
- Display a list of customer and get the customer id from the user.
- Get a reservation date from the user. (Perhaps use Java
Date object).
- List open rooms for the given date.
- Get list of rooms for reservation from user.
- Insert entries into reservation table and
room_reservation
table.
NOTE: To view customers and open rooms you can/should use the displayQuery()
method you wrote in the previous assignment.
NOTE: Be aware a SQL injection concerns.
- Cancel a Reservation
- List existing reservations and have user
select a reservation id. Then delete the appropriate reservation. NOTE:
What happens to entries in
room_reservation
when they cancel?
- List Current/Upcoming Reservations
- The list should contain reservations
from the current day and on into the future. (Do not show reservations in the
past). Once you build a proper query this become a simple call to displayQuery().
- Display Revenue for Current Month
- This query should group revenue for the month
by room number so we can see which rooms are generating the most revenue. This is
another call to displayQuery().
To turn in the assignment combine your source code file into a ZIP archive and upload
it into Canvas. Your assignment will be graded as follows:
Make Reservation |
12 pts |
Cancel Reservation |
3 pts |
List Reservations |
5 pts |
Display Revenue |
4 pts |
Menu, etc. |
2 pts |
Total |
26 pts |