(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.
![(7) In the main function, (i) declare a 2D array wkSales with sizes 4 and 6, then initialize it
with the three rows of sales figures, while leaving out the last row and last column figures.
Total
(iii)
(iv)
Items
Mon
Item 1. 22.2
Item 2. 11.1
Item 3. 33.3
Total:
Tue
33.3
66.6
44.4
Wed
55.5
22.2
55.5
Press any key to continue
.
Thu
22.2
44.4
66.6
Fri
77.7
88.8
99.9
Call the weeklySalesSummary function to fill the rest of the blank spaces of
Question 7.
Call the print WeeklySalesSummary function to display the table of Question 7 in
exactly the same format with inclusive of the totals of row 4 and column 6.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1abc8645-5be5-439d-b2c3-77d10625b21c%2F1a01e7ca-2835-48a3-b04a-d7746e027f0f%2Ffmlvyv_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)