Specification for Profit/Loss Statement -- versions 1, 2, 3, and 4


IDENTIFICATION: XYZloss.java
(where XYZ represents your initials)
PURPOSE: Produce a profit/loss projection,
and display the monthly information
sorted in various ways.

Version 1

Using arrays initialized with test data, produce a report similar to the following:

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 ... ... ...
You will need arrays such as the following (They may be "global".): Set the price per item to $10.

Version 2

Produce a similar report, with rows rearranged from highest profit to lowest (i.e. greatest loss).
To do this, you must sort all the arrays, using profit as the "key" field.

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.

Versions 3 & 4

Remove the test data, and initialize the arrays based upon input values such as the following: