Project 1: Business Management System

Due 07/11/05

FAQ

You are going to write a program for your own small business. (The business type is your choice, but keep it legal.) There are three parts to the project. Do each part separately first, in its own program. Then, combine the parts as functions into one program.

Remember good coding practices: use of well-written comments, good variable and function names, constants, functions, etc. (See the web pages and your lecture notes for more information about good style.)

Part 1: Calculating Employee Gross Pay

You need to pay your loyal employees, or they won't be loyal for very long. Write a program to compute an employee's weekly paycheck. If an employee works more than 40 hours, he gets paid time and a half for the overtime. (1.5*payrate*overtime_hours) If an employee works more than 60 hours, she gets paid double time for the overtime. (2*payrate*overtime_hours)

Example Runs:

Enter the employee's hourly wage: 10
Enter the number of hours the employee worked: 40
Gross Pay: $  400.00.
Enter the employee's hourly wage: 10
Enter the number of hours the employee worked: 41
Gross Pay: $  415.00.

Part 2: Calculating Employee Net Pay

(Please don't use these numbers to figure out your actual taxes. These values are just estimates.) As a responsible business owner, you must withhold taxes from your employees' paychecks. You need to withhold 3 types of taxes: The (simplified) Delaware State Tax bracket is calculated as follows:
Earning less than $60000/year: 5.55%
Earning more than or equal to $60000/year: 5.95%

The (simplified) Federal Tax bracket is calculated as follows:
Less than $15000/year: 8%
Less than $30000/year: 15%
Less than $90000/year: 27%
Otherwise: 40%

Extend the previous program (in another program) to calculate and print the amount of taxes to be withheld from the paychecks. Finally, print the employee's net pay.

Example Runs

Enter the employee's hourly wage: 10
Enter the number of hours the employee worked: 40

Gross Pay: $  400.00.
------Taxes Withheld------
   FICA:     $   24.80
  State:     $   22.20
    Fed:     $   60.00
--------------------------
Net Pay:   $  293.00.

Enter the employee's hourly wage: 10
Enter the number of hours the employee worked: 41

Gross Pay: $  415.00.
------Taxes Withheld------
   FICA:     $   25.73
  State:     $   23.03
    Fed:     $   62.25
--------------------------
Net Pay:   $  303.99.

Other requirements:

Write separate functions for calculating the FICA, DE state, and federal taxes, given the gross wages.

Calculate the appropriate federal tax bracket using a switch statement rather than a series of if-else-if statements.

Part 3: The User Menu

Put each of the first two parts in its own function. (Note that this means you will be calling functions in functions other than main.) Add a menu so that the user can choose to execute one of the above options (calculating the gross or net pay). Allow the user to exit the program cleanly (without doing "Control-C"). Use a switch statement to implement the user menu. (Why implement using a switch statement? Consider the program's extensibility.)

Demonstrating and testing your program

Refer to the top sheet for the required test cases that you must demonstrate.

Test plan (20 points)

Good programmers write a test plan before writing their code. They use the test plan to verify that the program operates as expected and to meet a customer's requirements.

Write your test plan in a separate file. (You can write the test plan in a format other than a plain text file in Emacs, if you would like.) Your test plan should include the program's input and its expected output. (How do you know the expected output?) Write a test plan for each of your programs. Follow the test plan in your script (after you've executed the required test cases).

Hints

Submission

The project is due at the beginning of class on July 11. Staple the top sheet to the top of your paper submission.

Submit the electronic copy via email to Gang before 6 p.m. on July 11 and the paper copy to Sara before class.

Sign up for a demo with either Sara or Gang on CPM during the week of July 11.

Grading

There are two components to your project grade: correctness and style.