Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 lab 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started