Answered step by step
Verified Expert Solution
Question
1 Approved Answer
| SAMPLE DATA FOR PROBLEM 1 USA 203 Washington Albania 132 Tirana Afghanistan 111 Kabul Barbados 97 Bridgetown Bahrain 123 Manama Problem 1 (15 points)
| SAMPLE DATA FOR PROBLEM 1 USA 203 Washington Albania 132 Tirana Afghanistan 111 Kabul Barbados 97 Bridgetown Bahrain 123 Manama Problem 1 (15 points) - Problem Statement Write a Java program that prompts the user to enter information about countries. The data for a country is to include the following information: 1. the country name; 2. the country population; 3. the capital city for the given country. Your program is to do the following: 1. prompt the user, asking how many countries will be entered; 2. prompt and store the data for each country, (the number of countries to be entered being that given in step 1 above; 3. display the name of the country with the largest population 4. display the name of the country with the smallest population; 5. sort the list of country information by population; 6. display the data for each country in order from least to greatest population. If the user were to enter the above data, the program would prompt the user in the following way: How many countries will be entered: 5 Please enter the country name: enter name Please enter the country population: enter population value Please enter the country capital: enter capital The country with the largest population is USA The country with the smallest population is Barbados In order of least to greatest population size, the countries are: Barbados Afghanistan Bahrain Albania USA Note: to receive credit, your solution may only use Programming I techniques. The data types for the names are to be of type String, and the data type for the population is to be of type integer
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