question

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Feb 2003
Posts: 7
Reputation: fastcarz3 is an unknown quantity at this point 
Solved Threads: 0
fastcarz3 fastcarz3 is offline Offline
Newbie Poster

question

 
0
  #1
Mar 3rd, 2003
A company pays its employees as managers (who recieve a fixed weekly salary), hourly workers (who recieve 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), commission workes (who recieve $250 plus 5.7% of their gross weekly sales), or pieceworkers (who recieve a fixed amount of money per item for each of hte items they produce-each pieceworker in this company works on only one type of item).


Can anyone help me out with the source code to calculate the weekly pay for each employee. there is no number of employees in advance. each type of employee has its own pay code managers have paycode , hourly workers have pay code 2, commission workers have code 3 and pieceworkers have code 4.

I need to use a switch to compute each employees pay according to that employees paycode. within the switch, i need to prompt the user (i.e...the payroll clerk) to enter the appropriate facts it needs to calculate each employee's pay according to that employee's paycode.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,057
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 129
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb
 
0
  #2
Mar 3rd, 2003
- What information about each employee is needed in order to compute the salary?

- How are different types of employees paid differently?

- How would you normally compute salary with time and a half (don't think in terms of programming)?

- How is the "paycode" used to determine how an employee gets paid?

- What does a switch statement do? How will it be useful here?

Try to answer these questions and then get back to us. I'm sure once you try to figure out the answers to these questions everything else will fall into place.

Break the assignment up into pieces. Separate it into questions like this, for example?

If you're still having problems even after you've tried to answer these questions, come back and I'll help you.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Join Date: Aug 2003
Posts: 37
Reputation: Xelfinn is an unknown quantity at this point 
Solved Threads: 0
Xelfinn Xelfinn is offline Offline
Light Poster
 
0
  #3
Mar 3rd, 2003
A week ago, I wouldn't have known how easy this program could be written with PHP.

All I would need to know are the pay codes....the rest would be interactive.

In C I would put the switch inside a while loop for continued interactivity. The switch would call functions for each code and return true if completed correctly. And the last case for a bad pay code would output a bad pay code statement and set the completed variable to false. After the switch is exited the competed variable would determine if the program outputs a general error statement. Then ask if the user would like to enter another pay code. If not, exit while and then exit program. Ha.

Of course the first time the program asks for a pay code would be before the while loop.

I guess in C++ you would create a Pay code class?
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 129
Reputation: Bob is an unknown quantity at this point 
Solved Threads: 1
Team Colleague
Bob Bob is offline Offline
Team Member
 
0
  #4
Mar 4th, 2003
fastcarz3:

Yet again you post a homework question and make no attempt to answer it yourself, probably because you don't know how to get started. Take a look at the reply I gave to your question a few days back, which gave you an approach to problem solving. It will help you with this problem and the next one you're going to post, and the one after that, and ...
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 1,135
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Solved Threads: 6
Team Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor
 
0
  #5
Mar 4th, 2003
I agree with Bob. Show that you've tried to do the problem. List some code if you have tried it or pseudocode. If you can't come up with even pseudocode, you'll make us wonder why you're attempting to program anything in the first place. You don't even list a possible solution or any sort of algorithm to solve it. I guess that shows what kind of person you are.

We are very happy to help anyone, at least I am. But helping someone takes time. Show us some consideration by at least making an attempt.
Check out my blog at http://www.shinylight.com for more stuff about web dev.
Reply With Quote Quick reply to this message  
Join Date: May 2002
Posts: 633
Reputation: aeinstein is just really nice aeinstein is just really nice aeinstein is just really nice aeinstein is just really nice aeinstein is just really nice 
Solved Threads: 9
Team Colleague
aeinstein's Avatar
aeinstein aeinstein is offline Offline
Team Member - aka kaynine
 
0
  #6
Mar 5th, 2003
My other post on this homework stuff pretty much sums up how I feel.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum


Views: 4411 | Replies: 5
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC