Hi guys,
I normally wouldn't bother you with such a simple problem but this is driving me up the wall.
I have to write a class called 'PeoplesAge'. The class contains the following methods: 'setNameandAge' and 'getAge'.
The getAge method has to find the ages of people between 20 and 30 and display the name and age (so the data has to be linked somehow if you see what I mean).
I will use the class from within an Applet and I cannot create new classes or methods (Sucks).
Ideally I want to use Vectors (the method of storage has to be dynamic). I am having problems linking the two vectors together (Name and Age vectors) so I can extract data from them.
The main problems arise because everything has to be done in these two classes and methods.
Can anyone suggest the best way to go about this? Would hashtables be the way forward? I'm not looking for someone to write the code for me, just point me in the general direction. Maybe some pseudo code ;o)
Many, many thanks for any help. I wouldn't ask if I weren't desperate.
TheOne
I normally wouldn't bother you with such a simple problem but this is driving me up the wall.
I have to write a class called 'PeoplesAge'. The class contains the following methods: 'setNameandAge' and 'getAge'.
The getAge method has to find the ages of people between 20 and 30 and display the name and age (so the data has to be linked somehow if you see what I mean).
I will use the class from within an Applet and I cannot create new classes or methods (Sucks).
Ideally I want to use Vectors (the method of storage has to be dynamic). I am having problems linking the two vectors together (Name and Age vectors) so I can extract data from them.
The main problems arise because everything has to be done in these two classes and methods.
Can anyone suggest the best way to go about this? Would hashtables be the way forward? I'm not looking for someone to write the code for me, just point me in the general direction. Maybe some pseudo code ;o)
Many, many thanks for any help. I wouldn't ask if I weren't desperate.
TheOne