I used one of your earlier post to get me started but I seem to be mixing up the variable. Please take a look at my code and see if you may be able to help me here. Thanks in advance.
I TRIED TYPING MY CODE IN THE SPACE PROVEIDE BUT LKEEP GETTONG ERROR MESSAGES pLEASE SEE ATTACHMENT OFR CODE
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.
The information required must be presented in the following order:
1. Display the original data set, as shown in the table.
2. A horizontal bar graph, showing the performance of each city, to the nearest million dollars.
3. The average profit for the supermarket chain.
4. The city with the highest profit.
5. A list of all the cities with profit at, or above the average.
6. The standard deviation of the profits.
7. 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 seven activities stated in the list of requirements.
( Design a test class called TestSupermarket. This class uses the JOptionPane class to read an integer value representing the number of cities, and uses this number to create the arrays. Next, it reads the name of each city with their associated profit amount into the respective arrays. For example, if there were only three cities you would enter:
In this context, each array would be of size three (3), and the values would be read into the arrays.
Create a Supermarkets object using the arrays as arguments to its constructor. Call the respective methods to carryout the requirements.
Number of downloads: 168