akosiraff

Download Population

Jul 30th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/population/
  3. Write a program that uses the ArrayList class to store objects. Do NOT use static
  4. arrays that we used in earlier chapters. Listing 11.8 on page 433 may be helpful. Write a
  5. program to store the name of a city and its population using 2 ArrayLists (one to hold
  6. the name and the other to hold the population). A sample input might look like:
  7. London 8000000
  8. Boston 600000
  9. Las Vegas 580000
  10. Once you have the data in the arrays, display the size of the arrays, ask the user to
  11. enter a city name and check if the name exists in the array. Allow the user to add more
  12. cities and to be able to remove cities. Display the contents of the arrays using its
  13. toString method. Allow the user to enter a city name and display the corresponding
  14. population. If the input city name does not exist, display a message. Calculate and
  15. display the total population of all the cities. Sort the data by population in ascending
  16. order and display the data in the original order and the sorted order. You may use any
  17. sorting algorithm that you like.
  18. Download: http://solutionzip.com/downloads/population/
Add Comment
Please, Sign In to add comment