As a frequent traveler, I want a program that provides access to a comprehensive list of airline inventory along with fa

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

As a frequent traveler, I want a program that provides access to a comprehensive list of airline inventory along with fa

Post by answerhappygod »

As a frequent traveler, I want a program that provides access to
a comprehensive list of airline inventory along with fares and
ticket operations through online transactions. Instead of going to
multiple sites, this will be a site that has a comprehensive
listing of inventory that includes reserving and canceling airline
tickets through automation and provides quick responses to
customers while maintaining passenger records. I need to create a
file of all the data that I would like to load while accessing the
data from the websites in java using external libraries using
classes such as Ticket, Flight etc.
I need to incorporate the following in to the java program
listed below:
All classes written and tested in isolation
A READEME File explaining how to run the program
Finalized UML to reflect the finished project that includes
multiple classes in a relationship and a UML diagram of each
class
Import.java.util.Scanner:
Public class AirlineReservationSystem{ Static int[] cnt= new
int[8] Static Boolean[] arrSeats = new Boolean[10]; Static scanner
sc = new scanner(System.in); Static int[][] flightdetails
={{0,0,0,0,0} {1, 2600, 4000,10,10} {2, 3000, 4500,10,10} {3, 2300,
4200,10,10} {4, 1800, 3800,10,10} {5, 2200, 4300,10,10} {6, 2500,
5000, 10,10} {7, 2000, 4000, 10,10} // SETTERS // assigns first
empty seat in relevant section public static boolean
assignSeat(int[] two){ if(getFreeSeats(two)) { cnt[two[0]] = +1;
printBoardingPass(cnt[two[0]], two[0]); } return true; } // returns
number of free seats in each section private static boolean
getFreeSeats(int[] two){ if(flightDetails[two[0]][two[1]] > 0) {
flightDetails[two[0]][two[1]] -= 1; return true; } else {
System.out.println("Seats are full."); return false; } } public
static void printGreeting(){ System.out.println("\nWelcome to
Charlene’s Airlines booking system.\n"); } // print the menu with
remaining number of seats for each section public static int[]
printMenu(){ int[] two = new int[2]; System.out.println("Flight ID
"+"Flight Routes: " + " Timing: " + "Economy Fares: (Rs) " +
"Business Fare: (Rs) "); System.out.println("1 "+"California " + "
4hrs " + "2000 "+ "4000"); System.out.println("2 "+"New York " + "
2hrs " + "2500 "+ "4500"); System.out.println("3 "+"Chicago " + "
3hrs " + "2200 "+ "4200"); System.out.println("4 "+"Hawaii " + "
9hrs " + "1800 "+ "3800"); System.out.println("5 "+"Alaska " + "
7:45hrs " + "2300 "+ "4300"); System.out.println("6 "+"Paris,
France " + " 8: 58hrs " + "3000 "+ "5000"); System.out.println("7
"+"Domincan Republic " + " 4:37hrs " + "2600 "+ "4600");
System.out.println("Enter the Flight ID: "); System.out.print(">
"); int flgId = sc.nextInt(); two[0] = flgId;
System.out.println("Choose the Class: "); System.out.println("3.
Economy Class"); System.out.println("4. Business Class");
System.out.print("> "); int classId = sc.nextInt(); two[1] =
classId; return two; } // prints the boarding pass private static
void printBoardingPass(int seat, int flightId){
System.out.println("\nBoarding pass for Charlene Airlines.");
System.out.println("Flight Id: " + flightId);
System.out.println("Seat No: "+ seat); System.out.println("Happy
Travels"); } // this is main class public static void main(String[]
args) { printGreeting(); int[] two = printMenu(); assignSeat(two);
} } -
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply