subject

Part 1: Sorting Arrays Develop a program that asks the user to enter a capital for a U. S. state. Upon receiving the user input, the program reports whether the user input is correct. For this application, the 50 states and their capitals are stored in a two-dimensional array in order by state name. Display the current contents of the array then use a bubble sort to sort the content by capital. Next, prompt the user to enter answers for all the state capitals and then display the total correct count. The user's answer is not case-sensitive.

Part 2: Sorting & Searching HashMap

Now revise the code to store the pairs of each state and its capital in a Map using the HashMap function. Display the content of the Map, then use the TreeMap class to sort the map while using a binary search tree for storage. Next, your program should prompt the user to enter a state and it should then display the capital for the state.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 00:00
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
question
Computers and Technology, 24.06.2019 23:30
True or false when a host gets an ip address from a dhcp server it is said to be configured manually
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
Your mother is sure that you were driving too fast because she knows a. when you arrived and the direction you came from. b. how long it took you to get home and how far you traveled. c. what time you left and how long it took you to get home. d. the direction you were driving and how far you traveled.
Answers: 2
question
Computers and Technology, 25.06.2019 06:30
If she presses the left arrow , what will happened
Answers: 1
You know the right answer?
Part 1: Sorting Arrays Develop a program that asks the user to enter a capital for a U. S. state. U...
Questions
question
Mathematics, 10.12.2021 19:10
Questions on the website: 13722363