Final Project - Ticket Management System
Upgraded
Introduction
Welcome to the Final Project for COMP90041 - Programming and Software Development!
For this project, we will extend the ticket management system to a real-life Ticket Management System. In your real life, you may use some kind of database. But we will handle and save data using files.
Ticket Management System still has two types of Users -
Admin - who can manage the concerts and prices
Customer - who can book tickets for the concerts.
Admin Operations - An admin can perform the following operations -
Admin can view all the concerts
Admin can view prices for seats for a concert and update them
Admin can view all bookings for all customers for a concert
Admin can see the total payment received for a concert
Customer Operations - A customer needs to select a concert to perform some actions.
Customers can view the prices for the concert seats
Customers can see the seat layouts
Customers can book multiple seats now
Customers can view all their previous booking details
Some of the operations are now removed from the previous assignments and there are a few new operations to perform by different kind of users.Preamble: "The Specifications"
The slides from this lesson module for the assignment act as "the specifications" for the system we are about to build.
"The specifications" in real-life software development is the document that details the features that should be implemented in any particular project. They are the features and requirements that you, the Software Developer, and the client have agreed should be implemented in the system.
As such, you should read these specifications carefully and ensure that your program implements the requirements of the specification correctly.
Tests will be run on your program to check that you have implemented these specifications correctly.
Note that for the Final Project, we will provide 20 visible tests that you can run to check that the basic functionality of your system is correct. There will be no hidden test cases. However, we will manually upload some different data files to rerun your program and assess the correctness of your code. So once your program passes the basic tests, we strongly recommend that you perform further tests yourself, to ensure that the required features have been implemented
correctly.
How to read the specifications?
Treat every scenario as new. Even though some operations may resemble previous assignments you may still need to implement them in a different way as the program complexity has increased.
We will show some of the scenarios as valid/expected/best-case scenarios. This section will be marked in green.
Best Case Scenario: This section describes a real-life intended scenario.
Some inputs to the program can be invalid and should be handled accordingly by the program.
These unexpected but valid scenarios will be tested and are shown below -
Worst Case Scenario: Your program may behave incorrectly if not handled explicitly. These inputs can be tested.
Just like the previous assignment, please read carefully through the out-of-scope specifications as well. This may be embedded as a red strip in the specifications sometimes.
Out of Scope Scenario: This scenario ........ is out of scope for this assignment
Other than this, we will use the general informational, warning, error, and assumption callouts using blue, yellow, red, and green coloured callouts.
Also, note that the code snippets have some characters in bold that represent the inputs to the program.
Students can assume that test cases only contain outputs that are explicitly part of specifications. The test cases, visible or hidden, do not produce any output that is not mentioned in the specifications explicitly. Please
note that the specifications will give you warnings and important notes where we expect special input handling. You should observe those and implement them accordingly as they will be tested while marking your program.Preamble: Intended Learning Outcomes
The Intended Learning Outcomes for the final Project are mentioned below -
Similar to previous assignments -
Control Flows - use branching and looping to navigate the special use cases in specifications.
Classes - identify the entities and encapsulate their data and actions together in a class.
Arrays or ArrayLists - to use 1D and 2D arrays/ArrayList and perform associated operations
Packages - identify and group logical entities(classes) together
Javadoc - generate javadocs from comments used in classes
Exclusive to the final Project -
UML - generate a UML Diagram for the classes
Inheritance - implement polymorphism correctly
Interfaces - implement some operations via interfaces
File Handling - reading and writing data from/to different files
Exception Handling - handle exceptions gracefully and appropriately
Java Collections Framework - using ArrayList or HashMaps to store and process data efficiently
Generics - Generics is optional for this final Project but you can gain some bonus marks if Generics is implemented correctly.
A warning to those who have previous programming experience in other programming languages (like C or Python) that follow a procedural programming paradigm: Be careful to develop your program using object-oriented principles, as programming and structuring your code in a way that is not object-oriented is an easy way to lose marks for structure in the assignments.Preamble: Structure and Style
We will also be assessing your code for good structure and style.
Use methods when appropriate to simplify your code, and avoid duplicate code.
Use correct Java naming conventions for class names, variable names, and method names and put them in a well-organised way in your code i.e. it should be readable as well. Look at the conventions provided by Oracle here.
Code structure in a file is very important and improves readability. Look at the code organisation conventions provided by Oracle here.
Make sure the names you choose are meaningful, to improve the readability of your code.
Ensure to add meaningful comments in between your code and Javadoc comments for classes and methods.
We will provide a marking scheme to help guide you in the development of your program.Academic Honesty
All assessment items (assignments, tests, and exams) must be your own, individual, original work.
Any code that is submitted for assessment will be automatically compared against other students' code and other code sources using sophisticated similarity-checking software.
Cases of potential copying or submitting code that is not your own may lead to a formal academic misconduct hearing.
Potential penalties can include getting zero for the project, failing the subject, or even expulsion from the university in extreme cases.
For further information, please see the university's Academic Honesty and Plagiarism website, or ask your lecturer.File Handling & Command Line Args
File Handling
Your program can launch in two modes - Customer mode or Admin mode. To run the program in any mode, it is important to read some data from the files and load them in the appropriate objects of classes (see guidance slide). There are atleast four or more files available to you. Four files that will always be present are mentioned below. These files are present in the assets folder.
Best Case Scenario: This section describes a real-life intended scenario.
1. concert.csv - This file contains data for all the concerts in a comma-separated format.
2. customer.csv - This file contains data for all the current customers in a comma-separated format.
3. bookings.csv - This file contains data for all the bookings made by all the customers in a comma-separated format.
4. venue_default.txt - This file contains a default layout for venues.
Note that the file names may change. They are passed in specific order via the command line params.
See the Command Line Arguments section below. You must not hardcode the file names in the code.
Venue Files - Venue files can change. They are not mandatory files except venue_default.txt mentioned above. When we test your code for assessment we may add/skip these files and some additional files.
1. venue_mcg.txt - This file contains a layout for a venue that is specific to MCG(Melbourne Cricket Ground)
2. venue_marvel.txt - This file contains a layout for the venue that is specific to Marvel Stadium.
Customer File
This file contains the following data in order
Customer ID - a unique ID to identify the customer
Customer name - Name of the customer (includes a space in case there is a First Name and a Last Name)
Password - a password that comprises of alphanumeric characters, @ and # symbols
Total Data Points: 3 fixed data points.Concert File
This file contains the following data in order mentioned below.
Concert ID - uniquely identifies a concert
Concert date - a date on which the concert will be held
Timing - the start time of the concert in format HHMM(24-hour format)
Artist Name - the name of the artist
Venue Name - the name of the venue where the concert will be held
Zone Type with prices - There are three zones in a concert - VIP, SEATING, and STANDING. Each
Zone has left, centre, and right sections of seats. For the STANDING zone, there are spots to
stand instead of seats. But we will use the terms seats and spots interchangeably. This string
describes the zone and its associated prices in the format ZONETYPE: LEFT SEAT PRICE: CENTRE
SEAT PRICE: RIGHT SEAT PRICE. For eg - VIP:359:499:399 means the zone type is VIP with the left section price set to AUD 359, centre section price set to AUD 499 and the right section price set to AUD 399.
Total Data Points: 8 fixed data points.
Booking File
The booking file contains bookings for all the concert for all the customers. The data follows the order
-
Booking ID - uniquely identifies a booking within a concert. That is Concert 1 can only have one booking id as 1. But another concert, say Concert 2, can also have a booking ID set to 1.
Customer ID - cross-reference to the customer ID from the customer list
Customer Name - the name of the customer who has booked the concert
Concert ID - uniquely identifies the concert for which booking has been made
Total Tickets - total number of seats booked in the booking. For eg - 3
Ticket Id - If 3 tickets(or seats) are booked then ticket Id will be 1/2/3.
Row number - The row number within a zone. This starts from 1.
Seat number - Within a row, the seat number which is booked.
Zone Type - VIP or STANDING or SEATING
Price - the price of the seat at the time of booking. Note that the price of the seat can be changed by admin. Thus it is important to save the price of the seat at the booking time.
Thus to derive an aisle number you will look at ZoneType and merge it with RowNumber. See the Venue File layout below for more details.
The last 5 data (Ticket Id to Price) repeat based on the Total Tickets booked. Thus for 2 tickets and 3 tickets booked the data may look like the following respectively.4,2,John Doe,2,2,1,3,6,VIP,259,2,3,7,VIP,259
1,1,Jane Doe,1,3,1,3,3,VIP,359,2,3,4,VIP,359,3,3,5,VIP,499
Total fixed data points: 5 (Booking id, customer id, customer name, concert id, total tickets)
Total variable data points: multiples of 5 based on total tickets (Ticket id, row number, seat number, zone type, price)
Out of Scope Scenario: A line in the booking file will never have an incorrect concert ID or customer ID that does not exist in their respective files.
Venue File
The Venue is now marked with Aisle Numbers. The Aisle Numbers start from the letters V for VIP, S
for SEATING and T for STANDING zones. The venue may look like this
V1 [1][2][3] [4][5] [6][7][8][9] V1
V2 [1][2][3] [4][5] [6][7][8][9] V2
V3 [1][2][3] [4][5] [6][7][8][9] V3
S1 [1][2][3] [4][5] [6][7][8][9] S1
S2 [1][2][3] [4][5] [6][7][8][9] S2
S3 [1][2][3] [4][5] [6][7][8][9] S3
T1 [1][2][3] [4][5] [6][7][8][9] T1
T2 [1][2][3] [4][5] [6][7][8][9] T2
T3 [1][2][3] [4][5] [6][7][8][9] T3
T4 [1][2][3] [4][5] [6][7][8][9] T4
This means that there are 3 rows each for VIP (that starts with the initial V: V1 to V3) and SEATING (that starts with the initial S: S1 to S3) and 4 rows for STANDING(that starts with the initial T: T1 to T4).
Each row has 3 seats in the left section, 2 seats in the middle section and 4 seats in the right section.
Worst Case Scenario: Your program may behave incorrectly if not handled explicitly. These inputs can be tested.
There will always be a venue_default.txt available to you. When you parse the concert.csv file if you see a venue name like MCG, you should look for a file venue_mcg.txt to load the venue. Similarly, if you see a venue name like abc you should look for a file venue_abc.txt. If you can not find the file venue_abc.txt or venue_mcg.txt you should load the venue layout from venue_default.txt file.
Note that the IDs (customer id/ concert id/ booking id) start from 1 as an index. You should take care when saving them in array/ArrayList as array indices start from 0.
Note that the files do not have a header describing the column names so you don't have to do special handling of the header vs the data.Command Line Arguments
There is a set of command line arguments that should be passed to the program. Some of these
parameters are optional. So you should take special care while handling these. The general format for
the command line args is like this - java TicketManagementEngine --admin|--customer [customer id] [customer password] customerFilePath concertFilePath boo
Note that the first param can be either --admin or --customer. The | signs represent or. The params in the [] means that they are optional. See the details below.
Admin Mode
Your code will have command-line arguments like this
$java TicketManagementEngine --admin ../assets/customer.csv ../assets/concert.csv ../assets/bookings.csv ../assets/ve the first param specifies the program is run in admin mode. the second param is the path to the customer.csv file. the third param is the path to concert.csv file the fourth param is the path to bookings.csv
The fifth and sixth params are optional and represent venue file paths. There could be more venue file paths following these as well. This is a variable list of paths.
While the file name can change from bookings.csv to bookings_incorrect.csv to abc.csv as well, but the order will remain the same - customer > concert > booking > variable list of venue files. You must not hardcode the file names in your program at all.
Note that venue_default.csv is not provided as a file path. You can assume (hard code or make it a constant in your code and set the default file path as assets/venue_default.txt ).
Customer Mode
The customer mode follows a similar pattern however the second and third parameters can be optional.
$java TicketManagementEngine --customer 1 abc@1 ../assets/customer.csv ../assets/concert.csv ../assets/bookings.csv .
the first param specifies the program is run in customer mode.
the second and third parameters are optional and represent customer id and password. the fourth, fifth, and sixth params are file paths to customer.csv, concert.csv and bookings.csv.
the seventh param is again optional and represents venue file paths. There could be more venue file paths following the seventh param as well.
Worst Case Scenario: Your program may behave incorrectly if not handled explicitly. These inputs can be tested.
In case the second and third parameters are missing, your program command line args will look like this.
$java TicketManagementEngine --customer ../assets/customer.csv ../assets/concert.csv ../assets/bookings.csv ../assets
You must handle the optional parameters appropriately.
In Edstem, this will be passed automatically. However, if you want to write code in your IDE, you must pass appropriate command line arguments.
When you quit the program, your program should write back any changes done to Bookings, Concert, and Customer back to the file path mentioned. Please do not override the Venue files.
IMPORTANT NOTE: Sometimes file handling is buffered internally by the operating system as well. This means if you PrintWriter.print , you may end up with an empty file. This can be an intermittent issue. To avoid this, please use .flush() methods.
Invalid User Mode
In case there is an invalid user mode provided, please print the error message and terminate the program.
$ java TicketManagementEngine --superuser ../assets/customer.csv ../assets/concert.csv ../assets/bookings.csv ../asse
Invalid user mode. Terminating program now.Exception Handling with Files
Several exceptions may happen in the program.
Worst Case Scenario: Your program may behave incorrectly if not handled explicitly. These inputs can
be tested.
1. FileNotFoundException or IOException - The file paths that are provided to you are not present
in the directory. Or are unavailable for File read/write operations. In this case, Java raises
FileNotFoundException or IOException. Your program should handle these correctly and terminate
the program. For example - this is printed when the file for bookings doesn't exist.
../asets/bookings.csv (No such file or directory)
2. InvalidLineException - Every file expects a minimum number of fixed data points. When these
data points are missing, you should raise an InvalidLineException, skip reading the line, print an error
message and move onto the next line. This will only happen for concert.csv, customer.csv and
bookings.csv. One of the following exception messages should be printed.
Invalid Concert Files. Skipping this line.
Invalid booking Files. Skipping this line.
Invalid Customer Files. Skipping this line.
3. InvalidFormatException - Some data points are rigid and some data points are flexible. For example, customer names can be anything. However, seat aisle numbers should either start from
V/S/T. In such cases, you must raise an InvalidFormatException and skip reading the line, print an error message and move onto the next line. One of the following exception messages should be printed.
Booking Id is in incorrect format. Skipping this line. // This is printed when booking id is not numeric
Customer Id is in incorrect format. Skipping this line. // This is printed when customer id is not numeric
Concert Id is in incorrect format. Skipping this line. // This is printed when concert id is not numeric
Incorrect Number of Tickets. Skipping this line. // This is printed when the total number of tickets is not numeric o
Invalid Zone Type. Skipping this line. // when the aisle numbers in Venue does not starts with V/S/T
4. IncorrectPasswordException - When the customer id and password are passed from the command line params and they do not match as per the customers.csv, you should raise this exception, print the message and terminate the program.
Incorrect Password. Terminating Program
5. NotFoundException: If the customer id is not found in the customer.csv file raise this exception, print the message and terminate the program.Customer does not exist. Terminating ProgramCustomer Main Menu
Customer Menu
Your program will run in customer mode when you provide the correct command line parameters.
Use Case 1: Customer mode with customer id and correct password
Best Case Scenario: This section describes a real-life intended scenario.
With the correct command line params (highlighted in bold below) you should print the welcome message as shown below. The password and customer id are present in the customer.csv file and should match. Note that the welcome message shows the customer's name (highlighted in bold to differentiate, you don't have to make the output bold.). The customer's name is also present in the customer file.
$java TicketManagementEngine --customer 1 abc@1 ../assets/customer.csv ../assets/concert.csv ../assets/bookings.csv .
Welcome Trina Dey to Ticket Management System
Select a concert or 0 to exit
---------------------------------------------------------------------------------------------------------------------
# Date Artist Name Timing Venue Name Total Seats Seats Booked Seats L
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 224 5 219
2 2024-10-04 Taylor Swift 1900 MARVEL 143 5 138
---------------------------------------------------------------------------------------------------------------------
>
The customer mode always asks to select a concert for which they can perform different options. See
the Select a concert section below.
Use Case 2: Customer mode with either incorrect customer id and incorrect password
Worst Case Scenario: Your program may behave incorrectly if not handled explicitly. These inputs can
be tested. When an incorrect password is passed, the program should terminate with the message shown in bold below.
$java TicketManagementEngine --customer 1 abc@1232 ../assets/customer.csv ../assets/concert.csv ../assets/bookings.cs
Incorrect Password. Terminating Program
When an incorrect customer id is passed, the program should terminate with the message shown in bold below.
$java TicketManagementEngine --customer 100 abc@1232 ../assets/customer.csv ../assets/concert.csv ../assets/bookings.
Customer does not exist. Terminating Program
Use Case 3: Customer mode with no customer id and password
Best Case Scenario: This section describes a real-life intended scenario.
If no customer id is provided in the command line params as shown below, then prompt the user to provide a name and password.
A customer id should be auto-generated. Read the last available customer id in customer.csv file, say
1, 2,3 is present in the file. So the last available customer id is 3. And then add 1 to generate the new
customer id = 4 in this case.
When you quit the program, this customer should be appended in the customer.csv file as well.
Note that the welcome message shows the customer's name (highlighted in bold)
Enter your name: Jane Doe
Enter your password: abc#1234
Welcome Jane Doe to Ticket Management System
Select a concert or 0 to exit
---------------------------------------------------------------------------------------------------------------------
# Date Artist Name Timing Venue Name Total Seats Seats Booked Seats L
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 224 5 219
2 2024-10-04 Taylor Swift 1900 MARVEL 143 5 138
---------------------------------------------------------------------------------------------------------------------
> Concert Selection
Customers can perform various operations like booking seats, viewing booking details etc about a concert. After the welcome message, you must print a list of concerts to select from. The concerts can be loaded from the concert.csv file. The user will select a concert as per the id mentioned in the file.
Once the user selects a concert, print the menu selection.
Out of Scope Scenario: The input to concert selection will either be the concert id or a 0. There won't be any invalid input here.
Welcome Trina Dey to Ticket Management System
________ ___ _____
Select a concert or 0 to exit
---------------------------------------------------------------------------------------------------------------------
# Date Artist Name Timing Venue Name Total Seats Seats Booked Seats L
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 224 5 219
2 2024-10-04 Taylor Swift 1900 MARVEL 143 5 138
---------------------------------------------------------------------------------------------------------------------
> 1
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
>
If the user selects a 0 then you should terminate the program by printing the message Exiting customer mode. Please ensure that all the changes made to Concert/Bookings/Customers should be saved back to the files.
Welcome Trina Dey to Ticket Management System
Select a concert or 0 to exit
---------------------------------------------------------------------------------------------------------------------
# Date Artist Name Timing Venue Name Total Seats Seats Booked Seats L
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 224 5 219
2 2024-10-04 Taylor Swift 1900 MARVEL 143 5 138
---------------------------------------------------------------------------------------------------------------------
> 0
Exiting customer mode
Tip: Use the format string "%-5s%-15s%-15s%-15s%-30s%-15s%-15s%-15s%n" to show the concerts.
Option 1: Show Ticket Costs
After selecting the concert id, if the user selects option 1 then show them the cost of ticket prices based on the zone. Note that there are various zones present and within a zone, the prices of seats in different sections can vary. These zones and prices come from the concert.csv file.
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
> 1
---------- SEATING ----------
Left Seats: 199.0
Center Seats: 199.0
Right Seats: 259.0
------------------------------
---------- STANDING ----------
Left Seats: 99.0
Center Seats: 99.0
Right Seats: 149.0
------------------------------
---------- VIP ----------
Left Seats: 359.0
Center Seats: 359.0
Right Seats: 499.0
------------------------------
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
>
Tip: Use the format string "---------- %8s ----------%n" to print the statements like ---------- VIP ----------Option 2: View Venue Layout
Customers can view the venue layout of the concert. A concert layout shows the available seats for the venue. The venue is loaded at the beginning of the program based on the venue name. See the
FileHandling Slide again. The venue layouts do not have any bookings in the venue_xxx.txt files.
However, when you read from the bookings.csv file, you should also show the booked seats to the customers while printing the venue layout, so that they don't book the already booked slides. X represents the booked seats in the venue layout. (See the bold highlighted texts. Note, you don't have to generate outputs in bold)
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
> 2
V1 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] V1
V2 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] V2
V3 [1][2][X][X][X] [6][7][8][9][10][11] [12][13][14][15][16] V3
S1 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] S1
S2 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] S2
S3 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] S3
S4 [1][2][3][4][5] [6][X][X][9][10][11] [12][13][14][15][16] S4
S5 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] S5
T1 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T1
T2 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T2
T3 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T3
T4 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T4
T5 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T5
T6 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T6
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
>
Option 3: Book Seats
In an actual booking system, you don't have to move around in the layout to select a seat. You can simply select using your mouse. However, in this case, we will use the keyboard. To book a seat you will print the layout first with the aisle numbers and seat numbers. You should also print the already booked seats marked with X. You should prompt the user to enter the aisle number, seat number and total number of seats to be booked. Out of Scope Scenario: When mapping the booked seats from the bookings.csv to the venue layout, you will always find valid aisle and seat numbers. There won't be a file that has an invalid booking with an incorrect aisle and seat number that does not match the venue layout.
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
> 3
V1 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] V1
V2 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] V2
V3 [1][2][X][X][X] [6][7][8][9][10][11] [12][13][14][15][16] V3
S1 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] S1
S2 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] S2
S3 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] S3
S4 [1][2][3][4][5] [6][X][X][9][10][11] [12][13][14][15][16] S4
S5 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] S5
T1 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T1
T2 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T2
T3 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T3
T4 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T4
T5 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T5
T6 [1][2][3][4][5] [6][7][8][9][10][11] [12][13][14][15][16] T6
Enter the aisle number: T1
Enter the seat number: 5
Enter the number of seats to be booked: 4
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
>
Once you have booked a seat(s), you should store it somewhere so that you can write the relevant data back to the bookings.csv when you exit the program. Take a look at the bookings.csv again to see what is the relevant information that gets stored.
How to generate booking id?
For the current concert and current customer find the maximum of the previous booking ids and simply add 1.
Out of Scope Scenario: Below scenarios are out of scope.
Not Enough Seats - Select the seat number say 15 and try to book 5 seats.Select an already booked seat.
Not Enough Seats - Select a seat next to a booked seat and try to book 2 seats. This will force you to choose the already booked seats and hence is not possible.
Choose an incorrect aisle number
Choose an incorrect seat number
Option 4: View Booking Details
When you read the bookings.csv file, for the same customer different bookings from different concerts can be present. Since you have selected a concert to perform an operation, when the customer wants to see booking details, you should show all the bookings that belong to the selected concert for this customer. If you created any bookings during the program run that were not previously present in the bookings.csv file, then that should be shown as well. This info has two parts -
1. A list of bookings showing the booking id, concert date, artist name, timing, venue name, seats booked and total price for all the seats booked.
2. For each booking there should be a ticket info printed. Each ticket info shows ticket id, aisle numbers, seat numbers, Seat Type and the price of the seats at the time of booking. Note that within a zone there are different sections with different prices, and hence price for each seat can vary.
Warning: Be extra cautious that you are showing booking details for the correct concert selected and for this specific customer only. As a customer, other customers should not be able to see your bookings or vice versa.
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
> 4
Bookings
---------------------------------------------------------------------------------------------------------------------
Id Concert Date Artist Name Timing Venue Name Seats Booked Total Price
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 3 1217.0
2 2024-10-01 Taylor Swift 1900 MCG 2 518.0
3 2024-10-01 Taylor Swift 1900 MCG 4 396.0
---------------------------------------------------------------------------------------------------------------------
Ticket Info
############### Booking Id: 1 ####################
Id Aisle Number Seat Number Seat Type Price
##################################################
1 3 3 VIP 359.0
2 3 4 VIP 359.0 3 3 5 VIP 499.0
##################################################
############### Booking Id: 2 ####################
Id Aisle Number Seat Number Seat Type Price
##################################################
1 4 7 SEATING 259.0
2 4 8 SEATING 259.0
##################################################
############### Booking Id: 3 ####################
Id Aisle Number Seat Number Seat Type Price
##################################################
1 1 5 STANDING 99.0
2 1 6 STANDING 99.0
3 1 7 STANDING 99.0
4 1 8 STANDING 99.0
##################################################
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
>
Tip: Use the format string "%-5s%-15s%-15s%-10s%-15s%-15s%-10s%n" to print booking list and "%-5s%-15s%-15s%-10s%-10s%n" to print the ticket info list.
If no booking is found for a concert, you should print an error message and return back to the menu.
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
> 4
No Bookings found for this concert
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
>
Option 5: ExitExiting the concert menu only exits from the current concert and prints the concert selection again.
You can proceed to perform operations with the same or other concerts or can choose to exit the program by selecting 0. See the Concert Selection at the beginning of this slide.
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
> 5
Exiting this concert
Select a concert or 0 to exit
---------------------------------------------------------------------------------------------------------------------
# Date Artist Name Timing Venue Name Total Seats Seats Booked Seats L
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 224 9 215
2 2024-10-04 Taylor Swift 1900 MARVEL 143 5 138
---------------------------------------------------------------------------------------------------------------------
>
Invalid Option
In case, someone provides an invalid input like -9 or 7, you should be able to print “Invalid Input” and prompt the user again with the menu to select a valid input again. Sample output
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
> 7
Invalid Input
Select an option to get started!
Press 1 to look at the ticket costs
Press 2 to view seats layout
Press 3 to book seats
Press 4 to view booking details
Press 5 to exit
> Admin Menu
Admin Menu
Your program will run in admin mode when you provide the correct command line parameters (highlighted in bold).
$java TicketManagementEngine --admin ../assets/customer.csv ../assets/concert.csv ../assets/bookings.csv ../assets/ve
You should print the appropriate welcome message and show the menu options.
Welcome to Ticket Management System Admin Mode.
________ ___ _____
|_ _| \/ |/ ___|
| | | . . |\ `--.
| | | |\/| | `--. \
| | | | | |/\__/ /
\_/ \_| |_/\____/
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
>
Option 1: View Concerts
Just like customers can see all the concerts, so can admin. You should load the concerts from the
concert.csv file.
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
> 1
---------------------------------------------------------------------------------------------------------------------
# Date Artist Name Timing Venue Name Total Seats Seats Booked Seats L
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 224 5 219
2 2024-10-04 Taylor Swift 1900 MARVEL 143 5 138 ---------------------------------------------------------------------------------------------------------------------
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
>
Option 2: Update Ticket Costs
Admin can update the ticket costs. In this version, the admin must select a zone first before updating the prices for sections.
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
> 2
Select a concert or 0 to exit
---------------------------------------------------------------------------------------------------------------------
# Date Artist Name Timing Venue Name Total Seats Seats Booked Seats L
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 224 5 219
2 2024-10-04 Taylor Swift 1900 MARVEL 143 5 138
---------------------------------------------------------------------------------------------------------------------
> 1
---------- SEATING ----------
Left Seats: 199.0
Center Seats: 199.0
Right Seats: 259.0
------------------------------
---------- STANDING ----------
Left Seats: 99.0
Center Seats: 99.0
Right Seats: 149.0
------------------------------
---------- VIP ----------
Left Seats: 359.0
Center Seats: 359.0
Right Seats: 499.0
------------------------------
Enter the zone : VIP, SEATING, STANDING: SEATING
Left zone price: 200
Centre zone price: 225
Right zone price: 220
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking detailsPress 4 to view total payment received for a concert
Press 5 to exit
>
Option 3: View Bookings
Unlike customer, admin can see bookings for all the customers. However, they need to select a concert first. Just like customer, you should print the list of bookings first followed by ticket info for each booking id.
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
> 3
Select a concert or 0 to exit
---------------------------------------------------------------------------------------------------------------------
# Date Artist Name Timing Venue Name Total Seats Seats Booked Seats L
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 224 5 219
2 2024-10-04 Taylor Swift 1900 MARVEL 143 5 138
---------------------------------------------------------------------------------------------------------------------
> 1
Bookings
---------------------------------------------------------------------------------------------------------------------
Id Concert Date Artist Name Timing Venue Name Seats Booked Total Price
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 3 1217.0
2 2024-10-01 Taylor Swift 1900 MCG 2 518.0
---------------------------------------------------------------------------------------------------------------------
Ticket Info
############### Booking Id: 1 ####################
Id Aisle Number Seat Number Seat Type Price
##################################################
1 3 3 VIP 359.0
2 3 4 VIP 359.0
3 3 5 VIP 499.0
##################################################
############### Booking Id: 2 ####################
Id Aisle Number Seat Number Seat Type Price
##################################################
1 4 7 SEATING 259.0
2 4 8 SEATING 259.0
##################################################
Select an option to get started!Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
>
Tip: Use the format string "%-5s%-15s%-15s%-10s%-15s%-15s%-10s%n" to print booking list and "%-5s%-15s%-15s%-10s%-10s%n" to print the ticket info list.
Option 4: Total Payment
For a selected concert id, admin can see the total payment received for the concert. This means for all the bookings for all the customers, you should sum up the price and show it.
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
> 4
Select a concert or 0 to exit
---------------------------------------------------------------------------------------------------------------------
# Date Artist Name Timing Venue Name Total Seats Seats Booked Seats L
---------------------------------------------------------------------------------------------------------------------
1 2024-10-01 Taylor Swift 1900 MCG 224 5 219
2 2024-10-04 Taylor Swift 1900 MARVEL 143 5 138
---------------------------------------------------------------------------------------------------------------------
> 1
Total Price for this concert is AUD 1735.0
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
>
Option 5: Exit
Admin should exit the program by printing the exit message. Please ensure that all the changes made
to Concert/Bookings/Customers should be saved back to the files.
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concertPress 5 to exit
> 5
Exiting admin mode
Invalid Option
In case, someone provides an invalid input like -9 or 7, you should be able to print “Invalid Input” and prompt the user again with the menu to select a valid input again. Sample output
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
> -9
Invalid Input
Select an option to get started!
Press 1 to view all the concert details
Press 2 to update the ticket costs
Press 3 to view booking details
Press 4 to view total payment received for a concert
Press 5 to exit
> Guidance: Object Oriented Programming
Quick Tips
Now that you know about UML, perhaps start designing your solutions by creating a UML first.
Think about what classes need to be created. Some of them are provided to you as the scaffold.
You can create other classes as well.
The second step is to associate appropriate data with appropriate classes. Create the data fields as instance variables in those classes.
The third step would be to create the exceptions.
The next step is file handling. This will take the maximum amount of time.
The next step is to create a structure for running the menu options with different Control Flows you have learned.
Exceptions thrown in a method are not handled in the same method. You should handle them with try-catch block in some other methods where you are invoking the method that is causing the exception. For example - when you use Integer.parseInt and the parseInt method throws a
NumberFormatException, you handle it in the method where you are using the Integer.parseInt. create packages like previous assignments to logically group entities and interfaces and exceptions as well.
generics are optional but may gain you some bonus marks.
Interfaces & Inheritance
Implement the inheritance as done in the previous assignment for customer vs admin. You must have atleast one inheritance hierarchy.
Think about what are the common operations for different entities. Interfaces are implemented where unrelated entities can have similar behaviour but different implementations. You must create and implement at least one interface.
File Parsing
Some files have a fixed width for each line. They have the same parameters for each line like Venue, Customers or Concerts.
Some files have different data for each line like Bookings.
When you read the files, you can read the entire line and then split the data on comma. This shall provide you with different data points in an array. Check the split method in the String class here. You can use this method to perform a split on other special characters present in data like underscore( _ ) or colon ( : ). Ticket Management System Upgraded
The starter code have been provided for you. Some classes are provided but packages are not created. You must create some packages and move the classes to the appropriate package except
TicketManagementEngine.java. TicketManagementEngine.java should not be moved under any package else your code won't run. Write the rest of the code to implement your program
there
We also provided some tests for your code, which will run automatically every time you hit "Mark".
You can run these tests as many times as you would like until the submission deadline.
Submission will close on 24 May 2024 at 1700 AEST.
Happy coding!Assessment
This project is worth 40% of the total marks for the subject. Your Java program will be assessed based on the correctness of the output as well as the quality of code implementation.
Automatic tests will be conducted on your program by compiling, running, and comparing your outputs for several test cases with generated expected outputs. The automatic test will deem your output wrong if your output does not match the expected output, even if the difference is just having extra space or missing a colon. Therefore, it is crucial that your output follows exactly the same format shown in the provided examples.
Passing the tests we provide here on edstem does not mean you will score full marks. Each submission will further be subject to hidden tests as well as manual inspection by our teaching team.Marking Scheme
Warning! You must make sure your code runs on edstem. If your code does not compile on edstem, 0 marks will be given.
COMP90041 Final Project: Marking Scheme
Student: [Student ID goes here]
Marking process:
1. Code compiles (Pre-requisite)
2. Run tests
3. Verify test results
4. Inspect code and fill in the sections below
1. Program Execution: Automated Tests
Gain 0.75 marks for each test. Minor differences cause loss of 0.25 marks
Visible tests passed: /20
Total tests passed: /20
Points awarded for this section: /15
2. System Architecture
Including: Code structure resembling real-world entities. Clear hierarchy by using separate, well named files for generics, abstract, and concrete classes. Use of package(s) to modularise code.
Points awarded for this section: /2
3. OOP & Encapsulation
Including: Proficient use of modifiers (private, public, protected) with appropriate getter/setter methods. Considering privacy leaks. Well-considered usage of static methods and free of redundant object passings.
Points awarded for this section: /34. Polymorphism
Including: Proficient use of abstract classes or interfaces, and inheritance. Classes are well-designed without redundancies and with elegant overloading.
Points awarded for this section: /3
5. Control Flow
Including: Easily traceable program flow. Loops have clear breakout conditions. Proficient use of switch and if-else statements. No system.exit or return statements from loops.
Points awarded for this section: /2
6. Data Structures & Algorithms
Including: Proficient use of a wide range of data structures. Elegant algorithmic design. Proficient use of the Java standard library and of java data types. Collections Framework like ArrayList, HashMap, and LinkedHashMap are encouraged.
Points awarded for this section: /2
7. File Handling
Including: Correct read/write of files including overwriting a file or appending a file wherever necessary.
Points awarded for this section: /3
9. Style
Including: Consistency around naming conventions and descriptive naming of classes, methods, and variables. Program code is well indented, spaces are sufficient, and avoidance of overly long lines of code.
Points awarded for this section: /2
10. Documentation and Javadoc
Run
javadoc -d doc *.java
Including: Javadoc created without errors. Following javadoc conventions. All major classes and methods are annotated. Additional in-line comments clarify complex program sections.Points awarded for this section: /2
11. UML
Including: Major classes and methods are listed with their correct association arrows and multiplicity values. The spatial arrangement allows for easy reading and shows a clear hierarchy between classes.
Package allocation is correctly displayed.
Points awarded for this section: /3
12. Exception Handling
Including: All exceptions handled including any system-generated exceptions like FileNotFound or
Arithmetic Exceptions.
Points awarded for this section: /3
13. Bonus marks
Including: Get upto 2 bonus marks for implementing Generics appropriately. Total marks won't exceed above 40 including the bonus marks.
Points awarded for this section: /2
Total Marks for the final project: / 40
Overall comments from marker: [Comments go here]
Assignment Marker: [Assignment marker name goes here]
If you have any questions regarding your mark, please contact the lecturersSubmission
Your submission should have the Java classes already provided to you and additional classes if you wish to include them. Your submission should also contain some packages.
Rearrange the classes to create some packages and update the import statements accordingly.
A starter code has been provided to you here on the edstem platform, but you are welcome to develop the project outside of the edstem environment, using your own IDEs.
Submission is made via edstem, however, and will be whatever code is saved on the Code
Challenge when the project deadline closes.
Your code MUST compile and run here on edstem. If your code does not compile we cannot mark it and you risk getting 0 marks.
“I can’t get my code to work on edstem but it worked on my local machine” is not an acceptable excuse for late submissions. In addition, submissions via email will not be accepted.
Be sure to copy your code into your Code Challenge workspace well before the deadline to avoid being locked out of submissions last minute.
Only the last version of your code before the submission deadline will be graded. It is highly recommended that you update your code on edstem frequently and well before the submission deadline. Last-minute "connection errors" are not a valid excuse.
In case you need an extension due to valid reasons, please fill up this form and we will follow up with you. Ensure you have a valid reason and proper documentation with you before seeking an extension. If you seek an extension beyond 10 days, contact STOP 1. See more here.