i have been working on a program that makes seating reservations for a virtual airline. the object of the program is for the user to be able to add and remove his/her seat. i'm having a very hard time with these two methods, can anyone help me?
Reservation system help
What kind of problems are you having? Are you asking conceptual questions or are you having an execution issue?
Is your code compiling? I could not get it to do so ...
One thing I saw was that the declaration of your "findSeat" method says that the method will be returning a char, but the variable you are returning is typed as a boolean. Then I noticed that you were probably having a problem with it since you weren't calling it since your choice "3" was commented out. This is the error which led to the "return value expected" compile error.
Many of your choice items are supposed to be a char but you just have a word there ... not a c == 'w' or the such ... I guess you just hadn't changed these placeholders, yet...
[a small English editing aside ... you are asking whether the person wants an "aisle" seat, not "isle" seat ... next to the passage separating columns of seats, not on an island ...]
I notice that you are trying to return the length of your Seating Chart to serve as an upper limit to the loops but your declaration of the method says that you are expecting a char type in "max" rather than the integer which is returned by the length value ... won't work ... change this to an int ...
After these changes are made your code runs into a problem with "smoking", in that the compiler was concerned that it had not been initialized.
After initializing smoking (I assigned a ' ' when it was declared) the program compiled but then ran into a run time array out of bounds error in a call to find seating while I was trying to select a seat.
I'll leave that to you to work out ... think about what length it is that is the loop control variable in the findSeat method ... and how you determine that value with a two dimensional array ...
Last edited by nspils; 02-21-2005 at 12:25 PM.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL