59.1k views
5 votes
Given storeMonthlySales NUM STOREST[NUM MONTHST[NUM DEPTS] is a three-dimensional array of floating point values. Write a C++ function, printMonthlySales, to calculate and print the total value of sales during a specific month by each department and in each store plus totals by store and department and overall sales. The return type of the function is void and the function must have 2 input parameters Sales array and the month the user specified (edit for correct month values!). The constants NUM STORES, NUM_MONTHS, and NUM_DEPTS must be accessed globally by defining the following global variables #define NUM DEPTS 2 #define NUM STORES 2 #define NUM-MONTHS 12 or const int NUM-MONTHS-12; or const in NUM_DEPTS 2; or const int NUM_STORES 2; The array Sales is initialized by the following statement within main() float storeMonthlySales[NUM STOREST[NUM MONTHS1[NUM DEPTS]- 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1,3.2, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 2.1, 2.2,2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2 Output: Sales for month of value (where value represents "January", "March", etc.) Dept # value value col value sum Dept # Store Total Store # value row value sum tore # value row value sum Dept Total col value sum total overall sales User enters a new month as many times as they wish and run printMonthlySales against the new month alue Validate user input ("y" or "n") when asking if the user wants to enter a new set of values

User RSlaughter
by
5.6k points

1 Answer

0 votes

Answer:

Y

Step-by-step explanation:

YEZ

User Robin Hawkes
by
5.3k points