(5) Create or add another source file called Business.cpp . In this file, declare and implement a function weeklySalesSummary which passes the 2D array, the row number of rows and number of columns which is a 4x6 matrix or table. The row data represents the daily sales for each item and column data represents each day’s sales for all items. Refer to the table in Question 7 below for reference. void weeklySalesSummary(double sales[][6], int row, int col) The function calculates the total of each row and updates the last column under Total with the calculated total on the right which is the 6th and final column. The function also calculates the total for daily sales for all items, and sets it at the last row along Total: row-header. This will include the total for the final 6th column. The coding will require two sets of nested loops. (6) Create and implement another function called printWeeklySalesSummary which passes the same parameter as those of Question 5, and this function prints the table in exactly the same format as presented below in Question 7. Tip: Use tabs or spaces, to arrange your columns and rows. The item #s will come from the incremented loop index.
(5) Create or add another source file called Business.cpp . In this file, declare and implement a function weeklySalesSummary which passes the 2D array, the row number of rows and number of columns which is a 4x6 matrix or table. The row data represents the daily sales for each item and column data represents each day’s sales for all items. Refer to the table in Question 7 below for reference.
void weeklySalesSummary(double sales[][6], int row, int col)
The function calculates the total of each row and updates the last column under Total with the calculated total on the right which is the 6th and final column.
The function also calculates the total for daily sales for all items, and sets it at the last row along Total: row-header. This will include the total for the final 6th column.
The coding will require two sets of nested loops.
(6) Create and implement another function called printWeeklySalesSummary which passes the same parameter as those of Question 5, and this function prints the table in exactly the same format as presented below in Question 7. Tip: Use tabs or spaces, to arrange your columns and rows. The item #s will come from the incremented loop index.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images