C.I.S. 1.5

Brooklyn College

Professor Langsam

 

Assignment #2

 

The MISER CORPORATION must meet its payroll within one week. They wish to save on pencils, paper and accountants. They have, therefore, decided to do all the calculations by computer. Having heard of your programming experience and your willingness to work for pennies, the company has hired you to write a complete C++ program, including comments to do the following:

 

1. Print the following heading at the top of the output page:

Miser Corporation Payroll

2. Read an unknown number of employee data records as shown below. Each group of data will contain an employee's first and last name, hours worked, rate of pay and age. A typical group of data will be:

Duck  Donald

45.0      3.25      51

Print the data as it is read; together with appropriate messages (e.g., the name is ..., the rate of pay is ..., etc.).

3. For each employee, compute and print the employee's base pay, which includes overtime (paid at one and a half times the normal rate) for each hour over 40. For example, if an employee earning $20.00 per hour works for 48 hours, then she will be paid for 40 hours at her normal rate plus 8 extra hours at $30.00 (one and a half times $20.00).

4. For each employee compute the tax paid by the employee, according to this formula: If the employee is 55 years old (or older), then the employee pays tax at a rate of 50% of the base pay; if the employee is below 55, then the tax is 10% of the base pay. Print the tax and the net pay after taxes.

5. Repeat this process until you have read the last employee. You must decide how to detect the end of the data (you should explain your method in a comment).

6. Print the age and name of the oldest employee. Do the same for the youngest employee.

7. After all your results have been printed, print a message saying that the payroll program is complete.

 

The data below is to be placed in a data file misercorp.dat. Make up 6 additional sets of data. Be sure to cover all possible cases. Make sure that your answers are correct before you hand in the program. All programs are to be commented, neatly indented, and in proper style. You are to hand in your source code, the printed results and a copy of your data file.

 

Data:

 

Duck  Donald

45.0                 3.50                 60

Mouse  Mickey

35                    3.50                 55

Brown  Charlie

35                    3.50                 20

Oyle  Olive

40                    3.50                 60

Man  He

45                    3.50                 20

Ra  She

40                    3.50                 20

Jetson  George

45                    3.50                 55

Starr  Brenda

35                    3.50                 60

Woman  Wonder

40                    3.50                 55

                        ...

Make up 6 more sets of data.