Question: java program Exercise 3: In this exercise, you will be developing a geography quiz that tests kids on their knowledge of countries and their capitals.

java program

java program Exercise 3: In this exercise, you will be developing a

Exercise 3: In this exercise, you will be developing a geography quiz that tests kids on their knowledge of countries and their capitals. Download the CountriesCapitals.txt file given next to the lalb link. This file has the country name on one line followed by its capital on the next Afghanistan Kabul Albania Tirana Etc Store the Country-Capital pairs as items in an unordered list. Your application must randomly select a country or a city and ask a question that matches a country to a capital or a capital to a country. It should then search the unordered list and report whether that answer is correct or incorrect. At the end of the program, display a statistic of how well the player answered the questions. Here's a sample screen dialog Welcome to the Country-Capital Quiz Play? Yes What is the capital of Canada? ottawa Correct. Play? Yes What country has Vienna as its capital? Austria Correct. Play? Yes What is the capital of Albania? Algiers Incorrect. The correct answer is Tirana. Play? No Game over. Game Stats: Questions played : 3; Correct answers: 2; Score: 66.67% NOTE: Only one output that shows a dialogue similar to the above is sufficient And the CountriesCapitals.txt is look like this: Afghanistan Kabul Albania irana Algeria Algiers Andorra Andorra la Vella Angola Luanda Antigua and Barbuda

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!