>Here is what i solved so far
Nice, you managed to write a bit of framework, but none of the solution at all. Be more specific about what the homework entails and I might help.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Step 1: what do you have?
Step 2: what do you want to have?
Step 3: how do you get from the data in step 1 to the data in step 2?
It's really really simple, you have a set of data and want to transform that into another set containing the same data.
Look at the API docs of Map. You'll find a method there that helps you a lot.
That's all I'll tell you, because it's all the help one can give you without writing the actual code which I'm definitely not going to do.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Have you looked at the API docs for List and Map?
You can do what you did in 1 line of code (or 2 if you write it out in a rather verbose syntax which teachers might want).
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337