Rewrite Programming Exercise 8.37? to store pairs of each state and its capital in a map. Your

Question:

Rewrite Programming Exercise 8.37?to store pairs of each state and its capital in a map. Your program should prompt the user to enter a state and should display the capital for the state.

Write a program that repeatedly prompts the user to enter a capital for a state. Upon receiving the user input, the program reports whether the answer is correct. Assume that?50?states and their capitals are stored in a two dimensional array, as shown in Figure. The program prompts the user to answer all states? capitals and displays the total correct count. The user?s answer is not case-sensitive.

image

Here is a sample run:

image

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: