All of the work in this project is my own!  I have not left copies of my code in public folders on university computers. I have not given any of this project to others. I will not give any portion of this project to others taking this class. I realize that the penalty for turning in work that is not my own can range from an "F" in the class to dismissal from Trinity University. 

                                    Print Title  ______________________________________    Time Required = ______.____ Hrs.

                                    Signature   ______________________________________    (pledged)


PayRoll Calculation Lab
Individual Homework Assignment
30 Points
 

start.c

1] Copy start.c to ???-HW4.c  Copy (replace ??? with your first name. - I would use Tom-HW4.c)


Important If You Want To Make Good Usage Of Your Time

Implement and test one module at a time!
Implement and test one module at a time!
Implement and test one module at a time!

Implement and test one module at a time!
Implement and test one module at a time!


Do While Loop

1] Write and study the following block of practice code in main( )

2] Review the do-while loop in your book if you need

3] Remove the practice code from your program.


Main Program Variables

main ()
{
int 

   EmployeeNo;
double
   PayPerHr,
   HoursWorked,
   Gross,        
   Tax,         
   Net;   
char

  Name[30];
       


Pass By Value - Pass By Reference - Textbook

1] If a function does not need to change variables, do not pass by reference!

2] Don't forget to put your prototypes at the top.

3] If you do not feel comfortable with if then else (from class and the example at the top) then look at a couple more examples in your text.

4] If you do not feel comfortable with the do while loop (from the example above) then look at a couple more examples in your text.


Program Documentation Box - Required Of All Programs From Now On!

1] Each and every program, from now on, shall have a main program documentation box at the very top. Do not use any tabs in the documentation box! Make the box 80 characters wide.

/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
//                         PayRoll Calculation - HW4                           //
//                                                                             //
// Purpose    : Calculate Net, Gross, and Tax for Employee PayRoll System.     //
//                                                                             //
// Written By : ???????????????????                  Environment : Linux       //
// Date       : xx/xx/xx                             Compiler    : gcc         //
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////


Function Documentation Boxes - Required Of All Functions From Now On!

1] Each and every function, from now on, shall have a function documentation box immediately above the function. Do not use any tabs in the documentation box! Make the boxes 80 characters wide.

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                             ClearScreen                                      //
//                                                                              //
//  Purpose    : Clear the console window on a UNIX/Linux System.               //
//                                                                              //
//  Written By : Dr. Thomas E. Hicks                  Environment : Linux       //
//  Date       : 2/10/02                              Compiler    : g++         //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

2] Include Function ClearScreen - you may copy and paste it from another program if you like.
 


Function Commercial

1] Include Function Commercial (Center it on an 80 character screen). Replace the ???? with your name.

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                              Commercial                                      //
//                                                                              //
//  Purpose    : Display a program banner on a clear screen. Banner includes    //
//               PayRoll Calculation System and author(s).                      //
//                                                                              //
//  Written By : Dr. Thomas E. Hicks                  Environment : Linux       //
//  Date       : 2/10/02                              Compiler    : g++         //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

                  PayRoll Calculation System
                         written by
                             ????


Function GetInfo

1] Module GetInfo needs to be passed variables EmployeeNo, PayPerHr, & HoursWorked.

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                 GetInfo                                      //
//                                                                              //
//  Purpose    : Interactively prompt the user for Name, EmployeeNo, PayPerHr,  //
//               and HoursWorked. Immediately stop if EmployeeNo = 0.           //
//                                                                              //
//  Written By : Dr. Thomas E. Hicks                  Environment : Linux       //
//  Date       : 2/10/02                              Compiler    : g++         //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

2] Write a loop which will continue to do the following


Function Calculate

1] Module Calculate will use variables PayPerHr, & HoursWorked  to calculate Gross, Tax,& Net. This module must be passed six of these variables. Pay time and a half for all hours over 40. Use a Tax Rate = 30 % for all.

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                 Calculate                                    //
//                                                                              //
//  Purpose    : Use the PayPerHr and HoursWorked to Calculate the Gross, Tax   //
//               and Net. Pay time and a half for overtime.                     //
//                                                                              //
//  Written By : Dr. Thomas E. Hicks                  Environment : Linux       //
//  Date       : 2/10/02                              Compiler    : g++         //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
 


Function Display

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                 Display                                      //
//                                                                              //
//  Purpose    : Neatly display the program information on a clear screen in    //
//               the format seen below:                                         //
//                                                                              //
//                           PayRoll Calculation System                          //
//                                  written by                                  //
//                                    ????                                      //
//                                                                              //
//  Employee Name...: John Doe                                                  //
//  Employee No.....: 10001                                                     //
//  Pay Per.........: 5.00                                                      //
//  Hours Worked....: 20.00                                                     //
//                                                                              //
//  
Gross...........: $ 100.00                                                  //

//  Tax.............: $ 30.00                                                   //
//  Net.............: $ 70.00                                                   //
//                                                                              //
//                                                                              //
//  Written By : Dr. Thomas E. Hicks                  Environment : Linux       //
//  Date       : 2/10/02                              Compiler    : g++         //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
 


Copy File To Dr. Hicks For Grading

1] Copy file tom-hw4.c  to /users/thicks/hw1320/hw4


What To Turn In

1] Signed copy of page 1 of this Lab.

2] Printed copy of the source code.

3] Nothing will be graded until you copy the file into the /users/thicks/hw1320 directory.

4] Nothing will be graded until this lab form is submitted.  Staple the pages. Fold the lab Horizontally (like a hot dog) and write your name nice and large on the outside.  Place it on the professor desk before the beginning of lecture on the day it is due. All assignments are due the next class period unless otherwise designated on the schedule page.