Write a program that lets the user enter four quarterly sales figures, Java programming help

May 1st, 2016
KateS
Category:
Other
Price: $35 USD

Question description

A company has six divisions, numbered 1-6. Write a program  that lets the user enter
four quarterly sales figures for these six divisions, in the order division 1 
quarter 1, division 1 quarter 2, division 1 quarter 3, division 1 quarter 4, 
division 2 quarter 1, etc. There should be input validation, allowing the user to 
only input positive numbers for sales figures. If a user inputs a negative number,
the program  should ignore it and prompt them again.

The figures should be stored  in a two-dimensional array  of doubles . 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 decrease  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

Tutor Answer

(Top Tutor) Daniel C.
(997)
School: UIUC
PREMIUM TUTOR

First let me help you with the increase and decrease part. To find the increase/decrease for each division, you'll need a for loop that iterates through each division. On each iteration, you'll need another for loop that iterates through the quarters. Have it start at the second quarter, or index of 1. The increase or decrease can be calculated by taking the value at the current index, and subtracting the value at index - 1.
To do increase/decrease for each quarter in each division looks something like thisfor (int divIndex = 0; divIndex < division; divIndex++){for (int qtrIndex = 1; qtrIndex < quarter; qtrIndex++){System.out.println("Division " + (divIndex + 1) + " change in quarter " + (qtrInd...

Studypool has helped 1,244,100 students

8 Reviews


Summary
Quality
Communication
On Time
Value
Five Star Tutor
Dec 6th, 2016
" Outstanding Job!!!! "
SjSurvivor143
Nov 21st, 2016
" Thanks for the help. "
Joemoe
Nov 7th, 2016
" <3 it, thanks for saving me time. "
tinytim47
Oct 29th, 2016
" Wow this is really good.... didn't expect it. Sweet!!!! "
pmallory
Oct 25th, 2016
" Totally impressed with results!! :-) "
mixedballz
Oct 16th, 2016
" excellent work as always thanks for the help "
kiln82
Oct 2nd, 2016
" awesome work thanks "
darnay
Sep 23rd, 2016
" The best tutor out there!!!! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1821 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors