Topical Information

This program is to help you in working with branches (mainly ifs). while continuing to hone your skills with main program design, variables and data types, and arithmetic. (There are opportunities for using standard library functions, advanced branching and looping practice, as well.)

Program Information

We here at Payroll'r'Us feel strongly that our company's service of printing payroll stubs for our clients' employees is a number one priority. That's why we are putting you in charge.

The client you'll be creating payroll stubs for (a manufacturer of fine Star Trek fan memorabilia) currently has only one salary rate for all of their employees. (But they hope that they'll soon be diversifying their line and so we shouldn't count on there always being only one salary rate!)

The current rate is 16.78 $/hour. This rate is paid for an employee's first 40 hours worked each week. If the employee is working overtime (hours beyond the first 40), those hours are paid at a rate one and a half times the normal pay rate.

Deductions from employees' pay include 6% withheld for social security tax, 14% withheld for federal income tax, and 5% withheld for state income tax. All employees are also a part of the local union and as such, $10.00 is withheld from each check for union dues.

Our client also participates in a group insurance program so that their employees can get good rates on health insurance. The current package says that workers with three or more dependents must pay $35.00 per pay check in addition to the employer's contribution. Other employees need not pay any additional insurance.

Each pay-stub should include information about the worker's hours worked for that period, their rate of pay, their gross earnings, all of the deductions that apply (you don't have to print $0.00 for employees who have less than three dependents, for instance), and the resulting net pay after all deductions are...well...deducted.


As an example, you might have the program interaction look something like (the parts in this color are typed by the user):

$ ./payroll.out

                 Welcome to the Payroll Program!!!

How many hours did you work this week?  30
How many children do you have?  4

Payroll Stub:

   Hours:   30.0
    Rate:   16.78 $/hr
   Gross:   $503.40

  SocSec:   $ 30.20
  FedTax:   $ 70.48
   StTax:   $ 25.17
   Union:   $ 10.00
     Ins:   $ 35.00

     Net:   $332.55

Thank you for using the PP!!

Endeavor to have a StarTrek-esque day!

$

(Your display need not come out as neatly as mine. I'm just a little obsessive. But if you'd like it that way too, we've discussed this to some extent elsewhere on the site. In fact, I'll give you extra levels to do so...)


Thought Provoking Questions

  1. How many branches do you have in your program? Are any nested inside each other (physically or virtually)? (The answer may change depending on your choice of options to implement...)
  2. How many tests are necessary to completely test all paths of execution? (The answer may change depending on your choice of options to implement...)
  3. What data types are number of children and number of hours worked?

This assignment is (Level 2).


Options


Total Level Possible

If you did all above options, this lab could be worth as much as (Level 14).