Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions