(Guess capitals) Write a JSF that prompts the user to enter a capital for a state, as shown in Figure 33.31a. Upon receiving the user input, the program reports whether the answer is correct, as shown in Figure 33.31b. You can click the Next button to display another question. You can use a two-dimensional array to store the states and capitals, as proposed in Exercise 8.37. Create a list from the array and apply the shuffle method to reorder the list so the questions will appear in random order.
FIGURE 33.31 (a) The program displays a question. (b) The program displays the answer to the question