Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program(In java) that lets the user enter four quarterly sales figures f

ID: 3621226 • Letter: W

Question

Write a program(In java) that lets the user enter four quarterly sales figures for six divisions of a company. The figures should be stored in a two-dimensional array. Once the figures are entered, the program should display the following data for each quarter:

- A list of the sales figures by division
- each division's increase or decease from the previous quarter (This will not be displayed for the first quarter)
- The total sales for the quarter
- The company's increase or decrease from the previous quarter (This will not be displayed for the first quarter)
- the average sales for all divisions that quarter
- the division with the highest sales for that quarter

Input Validation: Do not accept negative numbers for sales figures.

Explanation / Answer

By 2-dimensional, do you mean multi-dimensional? If so, you the representation of the 6 divisions and their quarterly figures would be as follows: double quarterly_sales[5][3]; The first value in brackets represents the columns in this case 6 (0 -5) and the second value the rows, which is 4. The columns will be used to refer to the division and the row will be used to refer to the quarter. For example, quarterly_sales[0][3] would refer to the 1st division's 4th quarter sales. That increase or decrease in sales from quarter to quarter can be calculated as the difference of current quarter from last quarter( or current quarter - last quarter) Some of the code for this might look something similar to the following: double quarterly_sales[5][3]; double total_sales[3]; for(int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote