It looks like you're on the right track. The first declaration doesn't look quite right, but on preview I see that's probably because the bulletin board formatter is adding an extra bracket. For the populating, I'd expect to see two nested loops, not just one. The inner loop would populate the zone prices, and the outer loop would take care of area prices. Part of the outer would involve instantiating new zonePrice maps and adding them to the areaPrice maps.
Joined: Oct 30, 2008
Thanks for the help.
I quite new to this, so please excuse my silly mistakes
This is what I tried but getting an error on the very last line.
No problem! Try to be more specific with your questions though. You say you get a problem on the last line, but is it a compile problem or a run-time problem? You can even paste in the exact error message.
In this case, I suspect you're getting a compile error, because you said areaPrices would be a Map with an Integer key and a Map<Integer, Double> value. You're trying to store a Double in it instead of the zonePrices Map. Why don't you start with pseudocode, or just a description of how you will populate your maps? If you post that here, I'd be happy to take a look at it and give you suggestions.