943,516 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 4881
  • C++ RSS
Mar 3rd, 2003
0

question

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fastcarz3 is offline Offline
7 posts
since Feb 2003
Mar 3rd, 2003
0
Re: question
- 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.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Mar 3rd, 2003
0
Re: question
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?
Reputation Points: 14
Solved Threads: 1
Light Poster
Xelfinn is offline Offline
37 posts
since Aug 2003
Mar 4th, 2003
0
Re: question
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 ...
Bob
Team Colleague
Reputation Points: 15
Solved Threads: 2
Junior Poster
Bob is offline Offline
129 posts
since Feb 2003
Mar 4th, 2003
0
Re: question
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.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
Mar 5th, 2003
0
Re: question
My other post on this homework stuff pretty much sums up how I feel.
Team Colleague
Reputation Points: 186
Solved Threads: 8
Team Member - aka kaynine
aeinstein is offline Offline
643 posts
since May 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Operating Systems assignment
Next Thread in C++ Forum Timeline: Java





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC