Write a program that will read monthly sales into a dynamically two-dimensional array. The program will prompt the user for the number of rows and columns. The rows represent each department (at least three) and the columns represent the time period (can be months, trimesters, or quarters). You will need to provide a function which determines the total yearly sales for each department, and another function that determines the total time-period sales for the company. Another function should determine the total company sales for a complete year. Finally develop a function that will print all results in a tabular manner. For example, if the time-period is quarters and the company has three departments, the printed results will resemble the table below.
Department Q1 Sales Q2Sales Q3 Sales Q4 sales Totals
Clothing $5,950 $6,320 $7,850 $9,985 $30,105
Sports $3,564 $9,750 $5,125 $8,650 $27,089
Electronics $9,500 $8,400 $8,900 $9,900 $36,700
Totals: $19,014 $24,470 $21,875 $28,535 $93,894
Follow the course’s naming conventions and indent your code for readability. Make sure that you comment your code appropriately.
|Due By (Pacific Time)
||10/22/2013 11:59 pm