(Sales Summary) I need your help.

Please Guys, I need your help. I don't understand were to start in writing a program to solve the problem below. I saw this question on my C++ How to program Textbook by DEITEL AND ASSOCIATE. Please i don't need the actual C++ code. All i need is the pseudo-code or some kind of explanation to aim my understanding of the concept. I will appreciate any effort regarding this correspondence. THANKS.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
(Sales Summary) 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). Once a day, each salesperson
passes in a slip for each different type of product sold. Each slip contains the following:
a) The salesperson number
b) The product number
c) The total dollar value of that product sold that day
Thus, each salesperson passes in between 0 and 5 sales slips per day. Assume that the information
from all of the slips for last month is available. Write a program that will read all this information
for last month’s sales (one salesperson’s data at a time) 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 for last month, 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 for last month; cross total each column to get the total
sales by salesperson for last month. Your tabular printout should include

*/




Since I don't know how much you know, I guess it's safe to show how I'd do it using a struct to hold:
a) The salesperson number
b) The product number
c) The total dollar value of that product sold that day[/quote

And a multidimensional array to hold:
[quote](Sales Summary) 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). Once a day, each salesperson
passes in a slip for each different type of product sold. Each slip contains the following:


A sample of the array would be:
slips DailySlips[4][5];

And then this part:
Assume that the information
from all of the slips for last month is available. Write a program that will read all this information
for last month’s sales (one salesperson’s data at a time) and summarize the total sales by salesperson
by product.

Looks to ask you to read in from an imaginary file (maybe create one yourself) and analyze the results

And then here:
All totals should be stored in the two-dimensional array sales. After processing all the
information for last month, 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 for last month; cross total each column to get the total
sales by salesperson for last month. Your tabular printout should include


It looks like it's just asking you to get a total of each persons total amount of slips and sales, which would just simply be a running tally.

A sample of your file might look like:
387264
FS470
500.00


The first being the salesperson's number, second being product number, third being total sales in dollars.
Last edited on
Thanks.
Topic archived. No new replies allowed.