Questions about the idea of the code
Hello,
I have homework in java, I just want to ask you some questions ( I don't want the whole code ).
A company has four salespeople (numbered from 1 to 4), who sell five different products (numbered from 1 to 5). Once a day, each salesperson passes in a slip for each type of product sold. Each slip contains the following:
The salesperson number,
The product number,
The total value of that product sold that day.
1. Propose a class Slip to store the data of sales slips.
2. Each salesperson passes in between 0 and 5 sales slips per days. Propose an array, slips, to store the data of sales slips for a whole month (31 days). Assume that the total value of each product never exceeds 99$. Write a method, collectSlips, to collect the sales information for a month by randomly filling the slips array.
3. Write a method, summarizeSalesSlips, that will read all this information for one month’s sales and summarize the total sales by salesperson and by product. All the totals should be stored in sales, a two dimensional array.
_______________________________________________
About Q2:
I did 3 for - loops.
1) start from 1 ---> 31 ( number of days )
........ 2) start from 1 ---> 4 ( number of Employees )
............... 3) start from 0 ---> 5 ( number of products )
set the values (salesperson number, product number, total) randomly
My questions are:
1) what is the appropriate size of the array as the numbers are creating randomly ( included zero in number of products)
2) Is my idea in Question 2 correct?
3) How to do the methode of summarizeSalesSlip - I mean the idea - ?
Thank you :D