Creating TreeMap Tutorial
We create our own TreeMap objects.
Print every region once
To print each region we must create our own list
As we process each country we add the region to our list. The
value we put in does not matter, we can use anything. Some regions
will be added many times - this doesn't matter each simply over-writes
Print each region just once.
The number of regions.
Number of countries in each region.
The program shown creates a new TreeMap called
- we put in every region of the world.
Print the number of countries in each region. Use 35 characters for the region and 3 characters for the number.
Number of large countries in each region.
Show the total population of each region
List large regions.
Print region and total population for those regions with a total population of at least 100 million.
Use 35 characters for the region name and 13 characters for the total population.