Problem

(Guess capitals and states) Revise Programming Exercise 9.17 to write an applet that rep...

(Guess capitals and states) Revise Programming Exercise 9.17 to write an applet that repeatedly prompts the user to enter a capital for a state or vice versa, as shown in Figure 18.16a. Upon clicking the Answer button, the program gets the user input from the text field, reports whether the answer is correct in a message dialog box (Figure 18.16b–c), shows the correct count and total count, and then displays the next question. The user can specify whether to let the program generate a question randomly or sequentially, and whether to generate questions for a capital or a state.

REF PRB:

(Guess the capitals) 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 twodimensional array, as shown in Figure 9.16. The program prompts the user to answer all states’ capitals and displays the total correct count. The user’s answer is not case-sensitive.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT