Question: Please show me how to write the code for the UML Diagrams. The following directory structure: bin/ Compiled Java files. src/ Java source code files:
Please show me how to write the code for the UML Diagrams.
The following directory structure:
- bin/ Compiled Java files.
- src/ Java source code files:
- sait/frms/application/
- sait/frms/gui/
- sait/frms/exception/
- sait/frms/manager/
- sait/frms/problemdomain/
- doc/ Generated Javadoc files.
- Ensure the private option is checked and everything is included in the generated documentation.
- lib/ Any third-party libraries. This folder can be empty.
- res/ Any resource or data files. This folder must include airports.csv and flights.csv.
- test/ Unit test cases. This folder can be empty.
- A Readme.txt file that contains:
- Projects title.
- The date.
- The authors.
- What the program does.
- List of deficiencies if any.
- How to run the program.
- A runnable JAR file in the root folder of the ZIP archive.
- Use the naming convention: Assignment2.jar.
It is to be built using only Eclipse IDE and JDK 1.8x.
Assignment Instructions
- You will use only the Eclipse IDE.
- The due date for this assignment is posted in D2L in the assignment submission area and in the provided calendar. Any assignment submitted after the due date will receive a zero.
- Submissions must be students original work. Refer to the Academic Misconduct (AC.4) policies and procedures.
Problem
A travel agency is looking to implement a flight reservation management system to improve its productivity and services. This is a big assignment. In order to tackle the big problem, you must break down the solution to three major parts:
Part 2 Functional back-end.
The supplied data files are to be placed in the res/ directory.
The UML Class Diagram shown below outlines the design of each of the manager and problem domain classes. You will need to provide the exception classes and determine where they are to be thrown.
| sait.frms.problemdomain |
|
| Flight | |
| - code: String - airlineName: String - from: String - to: String - weekday: String - time: String - seats: int - costPerSeat: double | |
| + Constructors + getCode(): String + getAirline(): String + getFrom(): String + getTo(): String + getWeekday(): String + getTime(): String + getSeats(): int + getCostPerSeat(): double + isDomestic(): boolean - parseCode(code: String): void + toString(): String | |
| sait.frms.problemdomain |
|
| Reservation | |
| - code: String - flightCode: String - airline: String - name: String - citizenship: String - cost: double - active: boolean | |
| + Constructors + getCode(): String + getFlightCode(): String + getAirline(): String + getName(): String + getCitizenship(): String + getCost(): double + isActive(): boolean + setName(name: String): void + setCitizenship(citizenship: String): void + setActive(active: boolean): void + toString(): String | |
| sait.fmrs.manager |
|
| FlightManager | |
| + WEEKDAY_ANY: String + WEEKDAY_SUNDAY: String + WEEKDAY_MONDAY: String + WEEKDAY_TUESDAY: String + WEEKDAY_WEDNESDAY: String + WEEKDAY_THURSDAY: String + WEEKDAY_FRIDAY: String + WEEKDAY_SATURDAY: String - flights: ArrayList - airports: ArrayList | |
| + FlightManager() + getAirports(): ArrayList + getFlights(): ArrayList + findAirportByCode(code: String): String + findFlightByCode(code: String): Flight + findFlights(from: String, to: String, weekday: String): ArrayList - populateFlights(): void - populateAirports(): void | |
| sait.frms.manager |
|
| ReservationManager | |
| - reservations: ArrayList | |
| + ReservationManager() + makeReservation(flight: Flight, name: String, citizenship: String): Reservation + findReservations(code: String, airline: String, name: String): ArrayList + findReservationByCode(String code): Reservation + persist(): void - getAvailableSeats(flight: Flight): int - generateReservationCode(flight: Flight): String - populateFromBinary(): void | |
Airports
The airports are included in the attached airports.csv. Each line in the file represents an airport with the following format:
Code,Airport i.e.: YYC,Calgary International Airport
Store airports in an ArrayList
Flights
The flights are included in the attached flights.csv. Each line in the file represents a flight record with the following format:
Flight Code,Departing Airport Code,Arrival Airport Code,Weekday,Time,Seats,Cost Per Seat i.e.: CA-8346,YYC,ATL,Thursday,20:15,174,501.00
Store flight objects in an ArrayList
The flight code uses the format LL-DDDD (L meaning Letter, D meaning Digit) and this needs to be validated. This can be done using regular expressions or by testing each character using the Character wrapper class. A flight cannot exist without a valid flight code. In all valid flight codes, the first two letters are an abbreviation and are used to determine the full name of the airline. The following is a list of possible airlines:
- OA Otto Airlines
- CA Conned Air
- TB Try a Bus Airways
- VA - Vertical Airways
Reservations
The travel agent makes the reservations using the management system. There are no predefined reservations that need to be loaded. Each reservation will be saved to a random-access file. Each reservation record will have the following:
- Reservation code The reservation code will be generated when a reservation is created.
- Flight code The flight code the reservation is for.
- Airline The airline who owns and operates the flight.
- Name The name of the traveler.
- Citizenship The citizenship of the traveler.
- Cost The cost of the reservation.
You are responsible for determining the data types and record size of each reservation in the random-access file. Save the random-access file in the res folder.
The reservation code must use the format LDDDD, where L is either D for Domestic or I for International and DDDD is a random number between 1000 and 9999. A domestic flight is a flight going from one Canadian airport to another Canadian airport. Only the Canadian airports start with the letter Y. You are not required to check if the reservation code is unique.
The name and citizenship of the traveler do not need to meet any specific format. However, they cannot be null or an empty string. Each flight has a limited number of seats and a check is needed to determine if a flight is full or not. Use proper exception handling techniques when creating reservations.
Once a reservation is made, the only information that can be changed is the travelers name and citizenship. These must be validated to ensure not null and not empty. The reservation record must be updated in the random-access file.
To cancel an existing reservation a soft or hard delete can be used. If you are using a soft delete, the cancelled reservation will not be included in the number of seats used on a flight. You may also use a hybrid delete, meaning a new reservation can overwrite an inactive reservation.
Notes
- The ReservationManager class generates the reservation code.
- Each reservation is for one seat only.
- The name and citizenship do not need to follow any specific format; however, they cannot be empty.
- Each problem domain class overrides the toString() method.
- Flight codes use the following format: (L meaning Letter, D meaning Digit)
- LL-DDDD (I.e.: GA-1234)
- Reservation codes use the following format: (L meaning Letter, D meaning Digit)
- LDDDD (i.e.: I1234)
- Times are in 24-hour format:
- HH:MM
- A reservation that is set to inactive is persisted and retained when the program opens again.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
