Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

read file from pc java program And the CountriesCapitals.txt is look like this: Afghanistan Kabul Albania Tirana Algeria Algiers Andorra Andorra la Vella Angola Luanda

read file from pc java program

image text in transcribed

image text in transcribed

And the CountriesCapitals.txt is look like this:

Afghanistan Kabul Albania Tirana Algeria Algiers Andorra Andorra la Vella Angola Luanda Antigua and Barbuda Saint John's Argentina Buenos Aires Armenia Yerevan Australia Canberra Austria Vienna Azerbaijan Baku Bahamas Nassau Bahrain Manama Bangladesh Dhaka Barbados Bridgetown Belarus Minsk Belgium Brussels Belize Belmopan Benin Porto Novo Bhutan Thimphu Bolivia La Paz Bosnia and Herzegovina Sarajevo Botswana Gaborone Brazil Brasilia Brunei Bandar Seri Begawan Bulgaria Sofia Burkina Faso Ouagadougou Burundi Bujumbura Cambodia Phnom Penh Cameroon Yaounde Canada Ottawa Cape Verde Praia Central African Republic Bangui Chad N'Djamena Chile Santiago China Beijing Colombia Bogota Comoros Moroni Congo, Democratic Republic of the Kinshasa Congo, Republic of the Brazzaville Costa Rica San Jose Cote d'Ivoire Yamoussoukro Croatia Zagreb Cuba Havana Cyprus Nicosia Czech Republic Prague Denmark Copenhagen Djibouti Djibouti Dominica Roseau Dominican Republic Santo Domingo East Timor Dili Ecuador Quito Egypt Cairo El Salvador San Salvador England London Equatorial Guinea Malabo Eritrea Asmara Estonia Tallinn Ethiopia Addis Ababa Federated States of Micronesia Palikir Fiji Suva Finland Helsinki France Paris French Guiana Cayenne Gabon Libreville Gambia Banjul Georgia Tbilisi Germany Berlin Ghana Accra Greece Athens Grenada Saint George's Guatemala Guatemala City Guinea Conakry Guinea-Bissau Bissau Guyana Georgetown Haiti Port au Prince Honduras Tegucigalpa Hungary Budapest Iceland Reykjavik India New Delhi Indonesia Jakarta Iran Tehran Iraq Baghdad Ireland Dublin Israel Tel Aviv Italy Rome Jamaica Kingston Japan Tokyo Jordan Amman Kazakhstan Astana Kenya Nairobi Kiribati Tarawa Atoll Kosovo Pristina Kuwait Kuwait City Kyrgyzstan Bishkek Laos Vientiane Latvia Riga Lebanon Beirut Lesotho Maseru Liberia Monrovia Libya Tripoli Liechtenstein Vaduz Lithuania Vilnius Luxembourg Luxembourg Macedonia Skopje Madagascar Antananarivo Malawi Lilongwe Malaysia Kuala Lumpur Maldives Male Mali Bamako Malta Valletta Marshall Islands Majuro Mauritania Nouakchott Mauritius Port Louis Mexico Mexico City Moldova Chisinau Monaco Monaco Mongolia Ulaanbaatar Montenegro Podgorica Morocco Rabat Mozambique Maputo Myanmar (Burma) Rangoon (Yangon) Namibia Windhoek Nauru No official capital Nepal Kathmandu Netherlands Amsterdam New Zealand Wellington Nicaragua Managua Niger Niamey Nigeria Abuja North Korea Pyongyang Northern Ireland Belfast Norway Oslo Oman Muscat Pakistan Islamabad Palau Melekeok Panama Panama City Papua New Guinea Port Moresby Paraguay Asuncion Peru Lima Philippines Manila Poland Warsaw Portugal Lisbon Qatar Doha Romania Bucharest Russia Moscow Rwanda Kigali Saint Kitts and Nevis Basseterre Saint Lucia Castries Saint Vincent and the Grenadines Kingstown Samoa Apia San Marino San Marino Sao Tome and Principe Sao Tome Saudi Arabia Riyadh Scotland Edinburgh Senegal Dakar Serbia Belgrade Seychelles Victoria Sierra Leone Freetown Singapore Singapore Slovakia Bratislava Slovenia Ljubljana Solomon Islands Honiara Somalia Mogadishu South Africa Pretoria South Korea Seoul South Sudan Juba Spain Madrid Sri Lanka Colombo Sudan Khartoum Suriname Paramaribo Swaziland Mbabana Sweden Stockholm Switzerland Bern Syria Damascus Taiwan Taipei Tajikistan Dushanbe Tanzania Dodoma Thailand Bangkok Togo Lome Tonga Nuku'alofa Trinidad and Tobago Port of Spain Tunisia Tunis Turkey Ankara Turkmenistan Ashgabat Tuvalu Vaiaku village Uganda Kampala Ukraine Kiev United Arab Emirates Abu Dhabi United Kingdom London United States Washington D.C. Uruguay Montevideo Uzbekistan Tashkent Vanuatu Port Vila Vatican City Vatican City Venezuela Caracas Vietnam Hanoi Wales Cardiff Yemen Sanaa Zambia Lusaka Zimbabwe Harare

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions

Question

Why should a consultants progress be regularly monitored?

Answered: 1 week ago

Question

define EFFECTIVE PARTICIPATION

Answered: 1 week ago