Help needed with an assignment thank you


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Help needed with an assignment thank you

  1. #1
    Join Date
    Jan 2006
    Posts
    4

    Help needed with an assignment thank you

    I have been thinking for a few days up to now and i still have no idea how to do it. help me!!!

    "The travel agency has 6 representatives. Each of them has an ID number.

    Consider how best to store these ID numbers not using six fields variables nor ArrayList. The IDs should be initialised in constructor of class Termunal.

    There is another class called Representatives where reps logging in. So when one of the reps logs in, it should check that the ID used to log in is valid."

    All help is really appreciated!!

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    A two dimensional array sounds like a choice, to me - using strings(?)

    Or parallel arrays - if you want to store int IDs in one and string name or other identifier in the other ...

  3. #3
    Join Date
    Dec 2005
    Location
    New Jersey
    Posts
    290
    Quote Originally Posted by nspils
    A two dimensional array sounds like a choice, to me - using strings(?)

    Or parallel arrays - if you want to store int IDs in one and string name or other identifier in the other ...
    Why not make a class Representative and just make an array of that? That seems much cleaner to me.

  4. #4
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    From the information given, this is supposed to be a structure of the Terminal class which has persistence. This requirement sounds like a lookup table to me. When a Representative attempts to log in, an instance of Representative is created, including the id number which the person logging in supplies. The instance is then passed to the Terminal class which checks whether or not the id number supplied in the instance matches its record of what that id number is supposed to be. If there is a match, then the Representative is allowed in ....

  5. #5
    Join Date
    Jan 2006
    Posts
    4
    Quote Originally Posted by nspils
    From the information given, this is supposed to be a structure of the Terminal class which has persistence. This requirement sounds like a lookup table to me. When a Representative attempts to log in, an instance of Representative is created, including the id number which the person logging in supplies. The instance is then passed to the Terminal class which checks whether or not the id number supplied in the instance matches its record of what that id number is supposed to be. If there is a match, then the Representative is allowed in ....
    yes you are right. Any ideas how to do it please? Thank you

  6. #6
    Join Date
    Jan 2006
    Posts
    4
    Quote Originally Posted by destin
    Why not make a class Representative and just make an array of that? That seems much cleaner to me.
    could u help me to write a code?Thanks

Similar Threads

  1. assignment operator
    By rssmps in forum C++
    Replies: 5
    Last Post: 12-19-2005, 05:10 AM
  2. Replies: 3
    Last Post: 10-21-2005, 10:06 AM
  3. Replies: 2
    Last Post: 07-02-2005, 12:35 PM
  4. java assignment array
    By librypat in forum Java
    Replies: 1
    Last Post: 07-16-2002, 11:03 AM
  5. help regarding java assignment
    By abbas in forum Java
    Replies: 0
    Last Post: 12-12-2001, 09:03 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