| | |
question
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2003
Posts: 7
Reputation:
Solved Threads: 0
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.
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.
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.
- 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

Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
•
•
Join Date: Aug 2003
Posts: 37
Reputation:
Solved Threads: 0
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?

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?
•
•
Join Date: Feb 2003
Posts: 129
Reputation:
Solved Threads: 1
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 ...
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 ...
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.
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.
![]() |
Similar Threads
- C command-line I/O question (C++)
- Apache Alias Directive... mod_alias question (Linux Servers and Apache)
- Completely new to C++ and have question about using char (C++)
- Question (Geeks' Lounge)
- question on cooling (Cases, Fans and Power Supplies)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the C++ Forum
- Previous Thread: Operating Systems assignment
- Next Thread: Duplication
Views: 4411 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






