-
Need help with this problem please.
Develop a class SmallPlane that models a plane that has a seat layout in which each row contains the same number of seats, as in Figure 1 above. The SmallPlane class has the following instance variable:
* An array of Seat objects. This should be a one-dimensional array.
The SmallPlane class has the following methods:
* A constructor with two int arguments specifying the number of rows of seats and the number of seats per row. The constructor should create the instance variable array (described above), and create Seat objects and assign them to the array.
* getSeat( String seatNumb ) which returns the Seat object which has the seat number specified by the method argument. This method should return null if the Seat specified by the argument does not exist.
The method getSeat() should work by comparing the seat number string for each seat in the instance variable array with the method argument, until a match is found. (A more efficient method is developed in TMA02.)
* getFreeSeats()
* getReservedSeats()
* getAllocatedSeats()
Each of the above three methods returns an array of Seat objects that have the status implied by the method name, or null if there are no seats with the relevant allocation status. Consider the possibility of using a helper method.
Also write a SmallPlaneTest class that creates a SmallPlane object corresponding to Figure 1 above, and which tests all the SmallPlane methods.
-
...and what have you done so far?
-
 Originally Posted by destin
...and what have you done so far?
Thanks for your speedy reply,
but I fixed the problem last night after some tiring persistence.
-
 Originally Posted by Ital_4
Thanks for your speedy reply,
but I fixed the problem last night after some tiring persistence.
That usually works
Similar Threads
-
By Irina in forum ASP.NET
Replies: 0
Last Post: 11-29-2002, 10:47 PM
-
Replies: 0
Last Post: 12-13-2001, 12:06 PM
-
By Roseta in forum VB Classic
Replies: 0
Last Post: 11-14-2001, 03:24 AM
-
By Ayman in forum VB Classic
Replies: 0
Last Post: 04-03-2000, 01:08 AM
-
By Jason Bock in forum VB Classic
Replies: 0
Last Post: 03-21-2000, 06:48 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks