Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program i 2: A wholesale company has five branch offices The quarterly sales figure for these branch offices are summarized in a table (to be
Program i 2: A wholesale company has five branch offices The quarterly sales figure for these branch offices are summarized in a table (to be represented by a 2-D array) is shown below: Branch-1 Branch-2 Branch-3 Branch-4 Branch-5 Total Quarter-1 150,000 273,550 124,300 57,800 79,430 Quarter-2 123,350 100,500 277,000 39,540 98,430 Quarter-3 67,000 232,000 122,500 17,000 320,000 Quarter-4 95,000 76,000 87,000 250,000 240,000 Total: Fig 2 Sales report by branch offices and by quarter. Using a 2-D array (to store sales figures by branch and by quarter as shown) and two 1-D arrays (to store column and row sums), write a program to compute and display values in blue cells (column sums) and brown cells (row sums). Convince yourself that each column sum represents total amount of sales generated by a particular branch office and each row sum represents the total amount of sales generated by all branch offices for a particular quarter. Also compute the value for the green cell, which represents the total amount of sales generated by all branches offices for the entire year. Your program should be composed of the main function, a function named fill2Darray and a third function named computeSales. The main function declares three arrays described above, calls the fill2DArray function to fill cells with values shown in Fig 2.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started