IDENTIFICATION: | XYZloss.java
(where XYZ represents your initials) |
PURPOSE: | Produce a profit/loss projection, and display the monthly information sorted in various ways. |
Month | Sales | Revenues | Expenses | Profit (Loss) |
January | 100 | 200.00 | 1000.00 | - 800.00 |
February | 200 | 400.00 | 1500.00 | -1100.00 |
March | 400 | 800.00 | 2000.00 | -1200.00 |
April | 800 | 1600.00 | 2500.00 | - 900.00 |
May | 1600 | 3200.00 | 3000.00 | 200.00 |
June | 3200 | 6400.00 | 3500.00 | 2900.00 |
... | ... | ... | ... | ... |
December | 4096 | ... | ... | ... |
Also produce a similar report showing all data, but with rows rearranged from highest to lowest expense amounts.
To do this, you must sort all the arrays, using expenses as the "key" field.
Finally, add another report report with the months listed in alphabetical order.
//// Some of your code might look similar to the following: // Compute fixed expenses for this month. exp[j] = exp[j-1] * (1.0 + expPct/100. ) + (expIncr) // Compute sales volume for this month. pct= salesInc1 OR salesInc2 (depending on which month). sales[j] = sales[j-1] * (1.0 + pct/100. )