Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

dont use oop like constructors methods and differet classes. everything should be in one main method Submitting the Assignment (5 points) Please submit the assignment

image text in transcribed

dont use oop like constructors methods and differet classes. everything should be in one main method

Submitting the Assignment (5 points) Please submit the assignment in the following way: 1) please zip your.java file and post the zipped file to D2L Assignments. The java file should include your name, class number and assignment number on the first three lines of the program, written as comments at the top of each java file; 2) in addition to the actual java file, please also turn in a.pdf copy of your.java file. Your.pdf should include both the java code and a sample run of your solution data. Note: points will be deducted for improper indentation, naming conventions, etc. SAMPLE DATA FOR PROBLEMI 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

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

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

ISBN: 3540511717, 978-3540511717

Students also viewed these Databases questions

Question

(3) Z (U + 2124), which is the set of all integers; Pg45

Answered: 1 week ago

Question

here) and other areas you consider relevant.

Answered: 1 week ago