Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Norm

Thread: Airplane Reservation again

  1. #1
    ChristianPaul is offline Member
    Join Date
    Mar 2014
    Posts
    1
    Rep Power
    0

    Default Airplane Reservation again

    Can You Help me Guys In my Project In JAVA ? PLease....
    I need it Neext week... I hope you can help me guys ... Thank you :)


    GIVEN :
    Airplane Seating Assignment: Implement using 2 Dimensional Array
    3 2-D arrays should be used in this program.

    Seats [ ][ ]
    PaassengerNames[ ][ ]
    Payments[ ][ ]

    Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with 6 seats in each row. Rows 1 and 2 are first class, rows 3 to 7 are business class, and rows 8 to 13 are economy class.

    Base Fare base on the Ticket Type
    First class – P 4000.00
    Business class – P 3500.00
    Economy Class – P 3000.00

    Additional Payments:
    Tax – 12% of Base Fare (mandated)
    Baggage (optional)
    15 kg below – P 300.00
    P 20.00 per additional kilogram excess
    Insurance(optional) – P 200.00

    Sample:
    If baggage is 15.1 kg, then its payment should be P 320.00. Any excess less than 1 kg is considered as 1 kg.

    Your program should prompts the user to enter the following information:
    a. Ticket type (first class, business class, or economy class)
    If ticket Type entered is beyond the range given your program should display a message stating that the user entered an invalid value.

    Make sure to check if there are still available seats under the specified ticket type before prompting the user to enter the desired seat. If for example, First class is already full, your program should prompt a message stating that the ticket type entered is already full and will select another ticket type.

    Else if ticket type is valid, it will proceed to the next statement asking for the desired seat.
    b. Desired seat
    This part is divided into two parts. The user should enter the desired Row base on the Ticket Type entered. If an invalid row is entered, display a message stating that a user entered an invalid row.
    Make sure to check if the row selected has seats available. If there’s none, you can prompt the user to enter another row or start all over from accepting Ticket Type. (the choice is yours)

    If the seat selected is still available, prompt a message that states seat has been reserved. If not, display a message stating that seats is not available. In your Seating Assignment Array, * should be replaced with X once the seat is reserved and that should not be replaced with another passenger.

    If the reservation is successful, prompt the user to enter the name of the Passenger. Ask for baggage if there’s any, if baggage is available, then ask for how many kilos. Ask also if the passenger wants to avail insurance.
    Payment computation:
    totalPayment = BaseFare +(BaseFare*12% tax) + Baggagge + Insurance

    Store the name of the passenger on the PassengersName [ ][ ] Array
    Store the totalPayment on the Payment[ ] [ ] Array

    Reservation of seats should continue until the user presses n or N or NO.

    If the user stops the reservation, prompt the user to search for some passenger stored in the arrays.

    Searching of elements should use the Row Number of seat and Column name.
    If found, it will display the name and payment of the passenger.

    Searching will continue until the user presses n or N or NO.

    Output the seating plan in the following format:
    The current seat assignments is as follows.
    A B C D E F
    Row 1 * * * * * *
    Row 2 * * * * * *
    Row 3 * * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    * -- available seat
    X -- occupied seat
    Here, * indicates that the seat is available; X indicates that the seat has beenassigned. Make this a menu-driven program; show the user’s choices andallow the user to make the appropriate choices.

    Sample Output:

    Seats Available
    A B C D E F
    Row 1 * * * * * *
    Row 2 * * * * * *
    Row 3 * * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to stop reservation.
    y
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    4
    Invalid Ticket Type!
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    1
    Enter Seat Row (1-2): 3
    Invalid Seat Row!
    Enter Seat Row (1-2): 1
    Enter seat number (A - F): G

    Invalid Seat Letter!
    Enter seat number (A - F): A

    Congratulations! Seat has been successfully reserved.
    Enter Passenger Name:
    Lim
    Do you have baggage?
    y
    How many kilograms?
    15.1
    Do you want to avail insurance?
    y
    Passenger Name: Lim
    Total Payment: 5000.0
    Seats Available
    A B C D E F
    Row 1 X * * * * *
    Row 2 * * * * * *
    Row 3 * * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to quit.
    y
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    1
    Enter Seat Row (1-2): 1
    Enter seat number (A - F): A

    Seat already occupied!
    Seats Available
    A B C D E F
    Row 1 X * * * * *
    Row 2 * * * * * *
    Row 3 * * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to quit.
    y
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    1
    Enter Seat Row (1-2): 1
    Enter seat number (A - F): B

    Congratulations! Seat has been successfully reserved.
    Enter Passenger Name:
    Say
    Do you have baggage?
    n
    Do you want to avail insurance?
    n
    Passenger Name: Say
    Total Payment: 4480.0
    Seats Available
    A B C D E F
    Row 1 X X * * * *
    Row 2 * * * * * *
    Row 3 * * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to quit.
    y
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    2
    Enter Seat Row (3-7): 3
    Enter seat number (A - F): A

    Congratulations! Seat has been successfully reserved.
    Enter Passenger Name:
    San
    Do you have baggage?
    n
    Do you want to avail insurance?
    n
    Passenger Name: San
    Total Payment: 3920.0
    Seats Available
    A B C D E F
    Row 1 X X * * * *
    Row 2 * * * * * *
    Row 3 X * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to quit.
    y
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    1
    Enter Seat Row (1-2): 1
    Enter seat number (A - F): C

    Congratulations! Seat has been successfully reserved.
    Enter Passenger Name:
    Dan
    Do you have baggage?
    n
    Do you want to avail insurance?
    n
    Passenger Name: Dan
    Total Payment: 4480.0
    Seats Available
    A B C D E F
    Row 1 X X X * * *
    Row 2 * * * * * *
    Row 3 X * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to quit.
    y
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    1
    Enter Seat Row (1-2): 1
    Enter seat number (A - F): D

    Congratulations! Seat has been successfully reserved.
    Enter Passenger Name:
    Ranma
    Do you have baggage?
    n
    Do you want to avail insurance?
    n
    Passenger Name: Ranma
    Total Payment: 4480.0
    Seats Available
    A B C D E F
    Row 1 X X X X * *
    Row 2 * * * * * *
    Row 3 X * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to quit.
    y
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    1
    Enter Seat Row (1-2): 1
    Enter seat number (A - F): E

    Congratulations! Seat has been successfully reserved.
    Enter Passenger Name:
    Rad
    Do you have baggage?
    n
    Do you want to avail insurance?
    n
    Passenger Name: Rad
    Total Payment: 4480.0
    Seats Available
    A B C D E F
    Row 1 X X X X X *
    Row 2 * * * * * *
    Row 3 X * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to quit.
    y
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    1
    Enter Seat Row (1-2): 1
    Enter seat number (A - F): F

    Congratulations! Seat has been successfully reserved.
    Enter Passenger Name:
    Gad
    Do you have baggage?
    n
    Do you want to avail insurance?
    y
    Passenger Name: Gad
    Total Payment: 4680.0
    Seats Available
    A B C D E F
    Row 1 X X X X X X
    Row 2 * * * * * *
    Row 3 X * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to quit.
    y
    ---TICKET TYPE---
    [1]--First ClasS
    [2]--Business Class
    [3]--Economy Class
    Enter Ticket Type:
    1
    Enter Seat Row (1-2): 1
    Row selected is already full.
    Seats Available
    A B C D E F
    Row 1 X X X X X X
    Row 2 * * * * * *
    Row 3 X * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Press y to reserve, n to quit.
    n
    Seats Available
    A B C D E F
    Row 1 X X X X X X
    Row 2 * * * * * *
    Row 3 X * * * * *
    Row 4 * * * * * *
    Row 5 * * * * * *
    Row 6 * * * * * *
    Row 7 * * * * * *
    Row 8 * * * * * *
    Row 9 * * * * * *
    Row 10 * * * * * *
    Row 11 * * * * * *
    Row 12 * * * * * *
    Row 13 * * * * * *
    Do you want to display passenger Information? Y for YES, N for NO
    y
    Enter Seat Row: 1
    Enter Seat Letter: A
    Passenger Name: Lim
    Total Payment: 5000.0
    Do you want to display passenger Information? Y for YES, N for NO
    y
    Enter Seat Row: 1
    Enter Seat Letter: F
    Passenger Name: Gad
    Total Payment: 4680.0
    Do you want to display passenger Information? Y for YES, N for NO
    n

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,409
    Rep Power
    25

    Default Re: Airplane Reservation again

    You forgot:
    to post the code you are having problems with
    and to ask some specific questions about those problems.
    typedef likes this.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Free Reservation System 0.1
    By java software in forum Java Software
    Replies: 0
    Last Post: 04-13-2013, 02:25 AM
  2. Airplane Reservation
    By RiterHeng in forum New To Java
    Replies: 5
    Last Post: 04-20-2012, 12:21 PM
  3. Hotel Reservation in JAVA (help)
    By BattalGazi in forum New To Java
    Replies: 4
    Last Post: 07-31-2011, 08:32 PM
  4. java reservation class plane seat and reservation classes
    By cool_guy364 in forum Advanced Java
    Replies: 2
    Last Post: 10-15-2009, 09:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •