This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Applets and the fly likes Airplane Reservation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Applets
Bookmark "Airplane Reservation " Watch "Airplane Reservation " New topic
Author

Airplane Reservation

John Lang
Greenhorn

Joined: Apr 19, 2012
Posts: 1
Okay so my assignment is this:

Write a Java Applet as a small airline reservation system. The system has only one airplane with 10 seats: 1 to 5 for first class and 6 to 10 for economy. The applet has two buttons and a text field for boarding pass. If the user clicked the First Class button, a currently availabe first class seat is printed in the boarding pass. If the user clicked the Economy button, a currently available economy seat is printed in the boarding pass. If the user selected section has no available seat, your program should ask if the user is OK with the other section seats. If the user clicked OK, you print the boarding pass of the assigned seat. If the user clicked Cancel, print "Next flight leaves in 3 hours"


I seem to have messed up the logic in my head and with what I have right now when running the program, when I click first or economy button, I get "Seat 6 has been reserved".
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Is this a question about a Java applet, or about RMI or other distributed technology. If its just about an Applet, perhaps one of the mods can move it to the right section.
Rene Ott
Greenhorn

Joined: Apr 20, 2012
Posts: 8

You are missing second '=' on line 54.
You have
but it should be .

Also, both these conditions and are equivalent.

Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Rene Ott wrote:You are missing second '=' on line 54.
You have


More than that, its very bad form to use even the proper == test.
Just write


 
GeeCON Prague 2014
 
subject: Airplane Reservation