Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Data Structures Java A program is required to do the following: Prompt for and accept for a list of countries, the name of the country,

Data Structures Java

A program is required to do the following:

Prompt for and accept for a list of countries, the name of the country, the population, and the gross national income (GNI).

Store this information in a finite list.

Compute and store the per capita income (PCI) for each country. This is found by dividing the GNI by the population.

Sort the countries based on per capita income (in ascending order)

Print all the values, including the per capita for all the countries (in ascending order)

Identify the country with the highest per capita income

Identify the country with the lowest per capita income

Determine and print the average per capita income and the standard deviation for the countries listed.

Continue processing until the user quits.

1. Develop the program plan and pseudo code for this problem. Your pseudo code must include plans for a Country class as well as a CountresMonitor class (your controller class).

1a. Your Country class must include the following:

UML diagram showing data items and methods that define a Country object. [08]

A constructor [04]

A method to modify a Country object based on another Country object. [08]

A method to allow the user input data for a Country object. [08]

A method to construct a string that fully describes the current Country object and returns it to the calling statement.

1b. Your CountresMonitor class must include the following:

UML diagram showing data items and methods. [10]

A main method to present the user with a menu of processing options and appropriately process each option. The options include entry of information on countries, summarization of the information, displaying a sorted list, and quitting processing. [12]

A method that allows entry of Country objects into the list, and invokes other methods to assist with the required processing. [10]

A method to evaluate the standard deviation and return it to the calling statement. [08]

A method that determines and stores the Country object with the highest PCI, and the Country object with the lowest PCI. [06]

A method to display the results (summary) of the analysis. [06]

A method to sort the countries in ascending order, based on the per capita income. [10]

A method to display the unsorted list [06]

A method to find and display a particular Country object in the list. [10]

A method to set initialization values for subsequent analysis.

Note:

1. The formula for standard deviation is as follows (this will be demonstrated in class):

Standard Deviation = Sqrt(( (PerCapita[x] AveragePerCapita)2 )/N)

2. Your submission must include the following files in your project folder, on a properly labeled zip-file:

Your program plan (which includes your UML class diagram and pseudo-code).

Project folder containing your Country and CountriesMonitor classes.

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

Real Time Database And Information Systems Research Advances

Authors: Azer Bestavros ,Victor Fay-Wolfe

1st Edition

1461377803, 978-1461377801

More Books

Students also viewed these Databases questions

Question

What are the types of forms of communication ?

Answered: 1 week ago

Question

Explain the process of MBO

Answered: 1 week ago