Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

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!!! :eek:

"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!!
[555 byte] By [dreamdim] at [2007-11-11 7:45:04]
# 1 Re: Help needed with an assignment thank you
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 ...
nspils at 2007-11-11 22:37:25 >
# 2 Re: Help needed with an assignment thank you
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.
destin at 2007-11-11 22:38:26 >
# 3 Re: Help needed with an assignment thank you
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 ...
nspils at 2007-11-11 22:39:29 >
# 4 Re: Help needed with an assignment thank you
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
dreamdim at 2007-11-11 22:40:35 >
# 5 Re: Help needed with an assignment thank you
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
dreamdim at 2007-11-11 22:41:28 >