How do you create a program that lists total commissions based on time frames for the day?
I don't need info on any specific language, just basic programming logic. I am working on a program that lists lists the total sales and total commissions earned by 7 salespeople during time frames of the day - 00–05, 06–12, 13–18, and 19–23. It's on a 24 hour clock. Any help or tips would be greatly appreciated.Thanks in advance.
Public Comments
- This isn't nearly so difficult a logic problem as it is a data storage problem. How are you going to keep track of this data? You could have four arrays of data, each one corresponding to a particular shift (graveyard, morning, afternoon, evening) Or maybe you have a single array full of data structures, each structure containing the person, commision, and shift. Or maybe you could have a 7x4 two-dimensional array, corresponding to the salespeople and their shifts. It really depends on what your data will look like and how you plan to utilize it. From there it's simply a matter of traversing through your data and systematically displaying what you want. Suppose you go with the single array of structures. Just go through the array, listing any data you want (or all of it, if that's your purpose) If your problem is inputting, I would keep track of each individual salesperson somehow. I would track the shifts in one of four categories (you can use an integer if you like), graveyard, morning, afternoon, and evening. Hope this helps.
- User Requirements ------------------------- Should be able to log time for each person should be able to log the Net total at the end of each shift Add/Edit/Remove employee or contact info and rates. Display daily commission for each Employee Functional Requirements -------------------------------- Calculate the commission according to the employee settings generate the sales done by Employee using Net Total Reset the net total to Zero at the Daily shift closing U can store all the 7 Employee info in a text file or an XML file Use add/edit/delete program to change data in this file every time when employee log in the net at the end of his/her shift it will check the earlier net and subtract from the current net total and save the difference under the employee day Sales variable ex daysales=current Net - earlier Net (at this point I assume that your Store policy is NO REFUNDS) then use your commission calculations and store the commission for each employee at the end of the shift, U have all the data U need to generate the report which will include the commission for each employee I guess that's pretty much to it All the Best!!!!!
Powered by Yahoo! Answers