Question: C++ Use a two-dimensional array to solve the following problem. A company has four salespeople (1 to 4) who sell five different products (1 to

C++

Use a two-dimensional array to solve the following problem. A company has four salespeople (1 to 4) who sell five different products (1 to 5).

Using the array, randomly generate the amount of sales each sales person sold per product. ( rand %300)

Write a program that will read all this information and summarize the total sales by salesperson by product. All totals should be stored in the two-dimensional array sales. After processing all the information, print the results in tabular format with each of the columns representing a particular salesperson and each of the rows representing a particular product. Cross total each row to get the total sales of each product ; cross total each column to get the total sales by salesperson for . Your tabular printout should include these cross totals to the right of the totaled rows and to the bottom of the totaled columns.

After generating the sales summary, identify the salesperson with the least sales. Reprint the report without that salesperson's sales.

Output should look like this:

S1 S2 S3 S4 Total

P1 100 250 299 159 808

P2 20 85 300 185 590

P3 50 152 265 158 625

P4 250 185 159 285 879

P5 150 300 200 280 930

Total 570 972 1223 1067 3832

The sales person with the least sales: S1

S2 S3 S4 Total

P1 250 299 159 708

P2 85 300 185 570

P3 152 265 158 575

P4 185 159 285 629

P5 300 200 280 780

Total 972 1223 1067 3262

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!