This repository consists of Java program for a Cruise Ship management System. This is a basic menu-driven command line program which I created as my Level 4 Sem 2 Software Development II coursework at University of Westminster. This program can manage activities like,
1) Allocate cabins for passengers
2) Delete passengers from cabins
3) Keep records of passengers' expences
4) Update expences passengerwise
4) Find passengers by using either first name or last name
5) View all cabin status
6) Display empty cabins
7) Save all customer data into a text(.txt) file
8) Load all data back again into the program
9) Order all passenger names alphabetically
In this program exception handling is properly done to deal with any kind of unexpected exception. Basically this program contains three main versions(as Packages).
1) Cruise_Ship_Boarding_Program_Task_1 - This is a basic version of the program with limited features. This version allows you to populate twelve cabins, one passenger for each cabin and perform basic activities like add & delete passengers, Display empty cabins, view all cabin status etc.
BOARDING SYSTEM FOR A CRUISE SHIP___
M: Show Menu
A: Add a Customer to a Cabin
V: View All Cabins
E: Display Empty cabins
D: Delete customer from cabin
F: Find cabin from customer name
S: Store program data into file
L: Load program data from file
O: View passengers Ordered alphabetically by name
X: Exit
________________________________________________________________
Enter your option :A
Enter Cabin Number (0-11) to Add a Customer (Enter 12 to Go Back):5
Enter Customer Name For Cabin 5 :John Garix
Customer JOHN Added to Cabin 5 Successfully
Enter your option :
Enter your option :v
Cabin 0 is Empty
Cabin 1 is Empty
Cabin 2 is Empty
Cabin 3 is Empty
Cabin 4 is Empty
Cabin 5 is occupied by JOHN
Cabin 6 is Empty
Cabin 7 is Empty
Cabin 8 is Empty
Cabin 9 is Empty
Cabin 10 is Empty
Cabin 11 is Empty
Enter your option :
Cabin 0 is Empty
Cabin 1 is Empty
Cabin 2 is Empty
Cabin 3 is Empty
Cabin 4 is Empty
Cabin 6 is Empty
Cabin 7 is Empty
Cabin 8 is Empty
Cabin 9 is Empty
Cabin 10 is Empty
Cabin 11 is Empty
Enter your option :d
Enter Cabin Number to Delete (Enter 12 to Go Back):5
Customer Deleted successfully
Enter your option :f
Enter Name to Find a Customer (q to Go Back):JOHN
Customer JOHN Located in cabin 5
Enter your option :
Enter your option :s
Successfully wrote to the file CabinInfo.txt
Enter your option :
File content of CabinInfo.txt
Cabin 0 is Empty
Cabin 1 is Empty
Cabin 2 is Empty
Cabin 3 is Empty
Cabin 4 is Empty
Cabin 5 is Occupied by JOHN
Cabin 6 is Empty
Cabin 7 is Empty
Cabin 8 is Empty
Cabin 9 is Empty
Cabin 10 is Empty
Cabin 11 is Empty
Enter your option :l
Cabin 0 is Empty
Cabin 1 is Empty
Cabin 2 is Empty
Cabin 3 is Empty
Cabin 4 is Empty
Cabin 5 is Occupied by JOHN
Cabin 6 is Empty
Cabin 7 is Empty
Cabin 8 is Empty
Cabin 9 is Empty
Cabin 10 is Empty
Cabin 11 is Empty
Enter your option :
Enter your option :v
Cabin 0 is Empty
Cabin 1 is Empty
Cabin 2 is occupied by ARICA
Cabin 3 is Empty
Cabin 4 is Empty
Cabin 5 is occupied by DAVID
Cabin 6 is Empty
Cabin 7 is occupied by HENRY
Cabin 8 is Empty
Cabin 9 is occupied by TEDY
Cabin 10 is Empty
Cabin 11 is Empty
Enter your option :o
ARICA
DAVID
HENRY
TEDY
Enter your option :
- This will terminate program *
2) Cruise_Ship_Boarding_Program_Task_2 - This version can hold upto 36 passengers, as 3 passengers per cabin. This version will hold passenger's first name, surname and expences and this consist an sdditional menu item "T" which will give the user the option to print the expenses per passenger as well as the total expenses of all passengers.
*BOARDING SYSTEM FOR A CRUISE SHIP___
M: Show Menu
A: Add a Customer to a Cabin
V: View All Cabins
E: Display Empty Cabins
D: Delete Customer From Cabin
F: Find Cabin From Customer Name
S: Store Program Data Into File
L: Load Program Data From File
O: View Passengers Ordered Alphabetically by Name
T: Print Expenses Per Passenger and Total Expense
U: Update Expenses
X: Exit
________________________________________________________________*
Enter your option :a
Enter Cabin Number (0-11) to Add a Customer (Enter 12 to Go Back) :2
Enter Customer 1 's First Name For Cabin 2. (Enter q to Go Back) :Loren
Enter Customer 1 's Surname For Cabin 2. (Enter q to Go Back) :Kim
Customer LOREN KIM Added to Cabin 2 Successfully
Enter Customer 2 's First Name For Cabin 2. (Enter q to Go Back) :John
Enter Customer 2 's Surname For Cabin 2. (Enter q to Go Back) :David
Customer JOHN DAVID Added to Cabin 2 Successfully
Enter Customer 3 's First Name For Cabin 2. (Enter q to Go Back) :Mary
Enter Customer 3 's Surname For Cabin 2. (Enter q to Go Back) :Yelan
Customer MARY YELAN Added to Cabin 2 Successfully
Enter your option :
Enter your option :v
Cabin 0 is Empty
Cabin 1 is Empty
Cabin 2 is occupied by |LOREN KIM| |JOHN DAVID| |MARY YELAN|
Cabin 3 is Empty
Cabin 4 is Empty
Cabin 5 is Empty
Cabin 6 is Empty
Cabin 7 is Empty
Cabin 8 is Empty
Cabin 9 is Empty
Cabin 10 is Empty
Cabin 11 is Empty
Enter your option :
Enter your option :e
Cabin 0 is Empty
Cabin 1 is Empty
Cabin 3 is Empty
Cabin 4 is Empty
Cabin 5 is Empty
Cabin 6 is Empty
Cabin 7 is Empty
Cabin 8 is Empty
Cabin 9 is Empty
Cabin 10 is Empty
Cabin 11 is Empty
3) Cruise_Ship_Boarding_Program_Task_3 - As an additional feature, a waiting list of 10 slots is added to the cruise ship. If the cruise ship is full(all cabins are occupied by passengers), then passengers will be added to the waiting list.
Definition of "cabin is full" - if at least one passenger is in the cabin, the program will consider it as an already occupied cabin.
Java 16 or higher
IntelliJ IDEA
- First you need to clone this repository
- Run this project as part of java code through IntelliJ IDEA.