CSCI 240 -- Assignment 4 -- Spring 2007

Points: 100
Due: February 16, Friday, 3 pm

For this assignment you will write a program that calculates payroll information for hourly and salaried employees (2 separate categories).

Your program should begin by displaying a brief set of instructions to the user. Then ask if the user wishes to continue or not. Do not use the exit() function if the user does not wish to continue, but rather code a loop whose body executes as long as the user's choice (to continue) is "y" or "Y". (Hint: use a pattern 1 loop.)  The user should be able to enter any number of payroll calculation requests. After each request, input of data, and display of results, the program will ask if another calculation is desired. When the user finally enters something other than "y" or "Y", the program will terminate.

For each payroll calculation request, your program should do the following:

Notes:

1. Use a symbolic constant to specify the tax rate.  Use a value of 0.08.

2. It is suggested that you develop your program incrementally. Don't write it all out on paper and then try to type it in and compile and debug it at once. Try a bit at a time. For example:

In general, this incremental approach is more efficient (i.e. you will have fewer errors and finish sooner). If you have an error, it will probably be in the bit of code you just added, and will be easier to find. Try to learn to think about how to adopt this approach in all the programs you do.

3. Notice that this program contains structures inside structures (loops in loops, decisions in loops, etc.) Be very careful about how you code these structures - especially in beginning and ending blocks with {} pairs and in formatting the code carefully. Pay attention to standard indenting of loop bodies and decision blocks. Each new level of "nesting" needs a new level of indenting.

4. Document your program according to the course Documentation Standards. Use appropriate numeric data types. These instructions should be considered standard for all subsequent programs.