Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
pls..i'm begging for your help.. Posted by zhazha on 30 Nov 2008 at 10:19 PM
Here is my problem:

Write a program to assign passengers seats in an airplane. Assume a small airplane with seat numberings as follows:

1 A B C D
2 A B C D
3 A B C D
4 A B C D
5 A B C D
6 A B C D
7 A B C D


The program should display th seat pattern with an 'x' marking the seats already assigned. For example, after seats 1A, 2B, and 4C are taken, the display should look like:


1 X B C D
2 A X C D
3 A B C D
4 A B X D
5 A B C D
6 A B C D
7 A B C D

After displaying he seats available,the program should prompt for the seats desired, the user can type in a seat,and then the display of available seats should be updated.this continuous until all seats are filled or until the user signals that the program should end. If the user types in a seat that is already assigned, the program should end. If the user types in a seat that is already assigned,the program should say that that seat is occupied and ask for another choice.
Report
Re: pls..i'm begging for your help.. Posted by cliffhanger on 1 Dec 2008 at 1:37 AM
: Here is my problem:
:
: Write a program to assign passengers seats in an airplane. Assume a
: small airplane with seat numberings as follows:
:
: 1 A B C D
: 2 A B C D
: 3 A B C D
: 4 A B C D
: 5 A B C D
: 6 A B C D
: 7 A B C D
:
:
: The program should display th seat pattern with an 'x' marking the
: seats already assigned. For example, after seats 1A, 2B, and 4C are
: taken, the display should look like:
:
:
: 1 X B C D
: 2 A X C D
: 3 A B C D
: 4 A B X D
: 5 A B C D
: 6 A B C D
: 7 A B C D
:
: After displaying he seats available,the program should prompt for
: the seats desired, the user can type in a seat,and then the display
: of available seats should be updated.this continuous until all seats
: are filled or until the user signals that the program should end. If
: the user types in a seat that is already assigned, the program
: should end. If the user types in a seat that is already assigned,the
: program should say that that seat is occupied and ask for another
: choice.
:


Its a simple Console based code..... tell me if u need it in Swing as it would take some time!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.