Design a class called supermarkets that accepts two arrays


Assignment

The management of a certain chain of supermarkets would like to know on a comparative basis the performance of its supermarkets in each city. The data in the following table shows the amount of profit for all of the supermarkets in each city.

City

Profit

Miami

$10,200,000.00

Sunrise

$14,600,000.00

Hollywood

$17,000,000.00

Tallahassee

$$6,000,000.00

Jacksonville

$21,600,000.00

Orlando

$9,100,000.00

Gainesville

$8,000,000.00

Pensacola

$12,500,000.00

Ocala

$2,000,000.00

Sebring

$4,500,000.00

The information required must be presented in the following order:
1. Display the original data set, as shown in the table.
2. The average profit for the supermarket chain.
3. The city with the highest profit.
4. A list of all the cities with profit at, or above the average.
5. The cities and their profit listed in descending order of the profits.

To carryout this exercise:
(a) Design a class called Supermarkets that accepts two arrays - one containing the names of the cities, and the other containing the profits. Write separate methods for each of the five (5) activities stated in the list of requirements.

(b) Design a test class called TestSupermarket that:

i. Reads the data using the class GetData
ii. Creates a Supermarket object using the arrays as arguments to its constructor.
iii. Call the respective methods to carry out the requirements.

NB: You may want to round these numbers to the nearest million.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Design a class called supermarkets that accepts two arrays
Reference No:- TGS02392201

Now Priced at $15 (50% Discount)

Recommended (99%)

Rated (4.3/5)