Need help with this problem please.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Need help with this problem please.

  1. #1
    Join Date
    Jan 2006
    Posts
    3

    Question 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.

  2. #2
    Join Date
    Dec 2005
    Location
    New Jersey
    Posts
    290
    ...and what have you done so far?

  3. #3
    Join Date
    Jan 2006
    Posts
    3

    Thumbs up

    Quote 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.

  4. #4
    Join Date
    Aug 2005
    Location
    Melbourne...Australia
    Posts
    279
    Quote 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

  1. Problem with Search
    By Irina in forum ASP.NET
    Replies: 0
    Last Post: 11-29-2002, 10:47 PM
  2. Replies: 0
    Last Post: 12-13-2001, 12:06 PM
  3. a problem with font and language
    By Roseta in forum VB Classic
    Replies: 0
    Last Post: 11-14-2001, 03:24 AM
  4. Arabic problem view
    By Ayman in forum VB Classic
    Replies: 0
    Last Post: 04-03-2000, 01:08 AM
  5. Problem with CryptoAPI and JCE
    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center