|
omfg... well, i may need help just understanding this problem...
Well, i have this problem on one homework assignment. I don't need help on the code as I'm breaking it down step by step, BUT, i'm just wondering if I'm overlooking this problem.
here it is, btw, this is C++
*********************
A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and "time-and-a-half"--1.5 times their hourly wage - for overtime hours worked), commisioned workers (who receive $250 plus 5.7% of their gross weekly sales), or pieceworkers ( who receive a fixed amount of money per item for each of the items they produce--each pieceworker in this company works on only one type of item).
Write a program to compute the weekly pay for each employee. You do not know the number of employees in advance. Each type of employee has its own pay code:
Managers have paycode 1, hourly workers have 2, commission workers have 3 and pieceworkers have code 4.
Use a switch to compute each employee's pay according to that employee's paycode. Within the switch prompt the user (i.e., the payroll clerk) to enter the appropriate facts your program needs to calculate each employee's pay according to that employee's paycode.
*********************
Well basically i broke it down in bits. I created if statements for the Hourly worker to display his pay regardless if he worked overtime or not. I coded the commisione worker. Salary = Whatever, and so on.
Then I see the finalized line.
How do I call the code within the switch function? WTF! Isn't the switch function a way to do things if you don't want to use the if/else statements? Do I just paste my code within a case then break? Or am I just overlooking something here because this prick wants too much from a n00b?
I can post my code if need be.
|