Now follow the UML class diagram and the description below and complete the back-end class called Department.                                                                                             Department - sales: double[][] + Department() + populateArray(): void + calculateAvgSalesPerMonth(double[]): void + calculateAvgSalesPerDepart(double[]): void + determineHighestMonthlySales(int): void + determineHighestDepartSales (int): void       Attribute/Method Description sales Data members. The sales is a two-dimensional array that can store for a maximum of 4 departments (not all stores have 4 departments), the sales for each month of the last three months (See Fig. 1). Department () The constructor is used to initialize all data members to default values. populateArray() This method must populate the array with user input. The information can be similar to the one found in Figure 1 calculateAvgSalesPerMonth (double[]) This method must return a one-dimensional array holding the calculated average sales for each of the 6 months for all departments that has sales figures. calculateAvgSalesPerDepart (double[]) This method must return a one-dimensional array holding the calculated average sales for each department that has sales figures, over the six months. determineHighestMonthlySales (int) This method must receive an integer month number (1-3), and will return the department number with the highest sales figure for that month. (Remember that not all departments may have sales figures entered). determineHighestDepartSales (int) This method must calculates and returns the month number of the month with the highest sales in a department, receiving an integer value indicating for which department it must be calculated (1-5).

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

You are asked to develop a program that will manipulate sales data for the departments for each month of the last three months for a chain of Clothing Stores.

 

                                               

Month:

1

2

3

Dept:

1

455000

325000

411000

2

538000

123000

645000

3

378000

259000

496000

4

440000

612000

537000

 

Fig. 1: An EXAMPLE of the Data for the Two-Dimensional Array, where all 4 departments have sales figures entered.

 

Task 1

 

Now follow the UML class diagram and the description below and complete the back-end class called Department.                                                                                          

 

Department

- sales: double[][]

+ Department()

+ populateArray(): void

+ calculateAvgSalesPerMonth(double[]): void

+ calculateAvgSalesPerDepart(double[]): void

+ determineHighestMonthlySales(int): void

+ determineHighestDepartSales (int): void

 

 

 

Attribute/Method

Description

sales

Data members.

The sales is a two-dimensional array that can store for a maximum of 4 departments (not all stores have 4 departments), the sales for each month of the last three months (See Fig. 1).

Department ()

The constructor is used to initialize all data members to default values.

populateArray()

This method must populate the array with user input. The information can be similar to the one found in Figure 1

calculateAvgSalesPerMonth (double[])

This method must return a one-dimensional array holding the calculated average sales for each of the 6 months for all departments that has sales figures.

calculateAvgSalesPerDepart (double[])

This method must return a one-dimensional array holding the calculated average sales for each department that has sales figures, over the six months.

determineHighestMonthlySales (int)

This method must receive an integer month number (1-3), and will return the department number with the highest sales figure for that month. (Remember that not all departments may have sales figures entered).

determineHighestDepartSales (int)

This method must calculates and returns the month number of the month with the highest sales in a department, receiving an integer value indicating for which department it must be calculated (1-5).

(in java form)

 

 

 

 

 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY