Question: CODE IN C++ ( No Functions! ) You should use the following input data from a file. You have to create a file using the

CODE IN C++ (No Functions!)

You should use the following input data from a file. You have to create a file using the note pad and type in the following information.

The first column is the social insurance number, the second column is pay rate, the third column is number of exemptions and the fourth column is hours worked.

Social insurance number: a 9 digit number (long int should be used)

Pay rate: a decimal number (use float data type)

Number of exemptions: a whole number (use int data type)

Hours worked: a decimal number (use float data type)

123456789 25.5 3 40.0

234567812 15.5 4 45.0

234512345 16.3 0 60.0

123456799 15.5 3 40.0

213456782 25.5 5 50.5

123452345 17.5 2 35.0

123456321 -10.5 2 24.5

213345657 10.5 -2 45.0

123533212 17.2 3 -25.0

423556578 19.5 20 65.0

555555125 30.0 3 35.5

293049506 15.0 2 0.0

938950677 0.0 0 0.0

766445667 25.5 10 40.0

432123567 20.5 7 25.5

You should do input data checks. If the input data is negative an error message should be printed.

Number of exemptions should be from 0 to 19.

Your output should be formatted as follows:

Company Name

Social insurance no. gross pay net pay pension deductions

Summary Report

Number of employees processed:

Total gross pay for all employees:

Total net pay for all employees:

Total pension withheld for all employees:

Total deductions for all employees:

Need to hand in:

1. User Documentation

2. Programmer Documentation flowchart or pseudo codes

3. Program listing

4. Screen shots of input and output files

PROBLEM: Develop a program to process the weekly payroll of the Brooks Leather Company (BLC). For each employee of BLC your program will compute the gross pay, deductions, and net pay. This information is to be clearly printed in the output.

Each week BLC enters the following information into a data file called 'paydata' for all the employees:

Sample input data:

123456789 25.5 3 40

234567812 15.5 4 45

234512345 16.3 0 60

Social insurance number (9 digits)

Hourly pay rate (xx.xx)

Number of exemptions (0 to 19)

Hours worked (xx.x)

Using this file of information for all the employees, your program should carry out the following computations.

(a) Gross Pay Regular pay for the first 40 hours and time-and-a-half beyond

that up to a limit of 54 hours in any given week. Any hours more

than 54 will get regular pay.

(b) Deductions Let grossPay represent gross pay and taxablePay represent taxable

pay. Let exempt represent the number of exemptions.

(i) Federal income tax withholding (federal) is defined as:

taxablePay = grossPay - $14.00 * exempt - $11.00

federal = taxablePay *(0.14 + 2.3 x 10-4 * taxablePay)

(ii) Provincial income tax withholding (prov) is defined as

35% of the amount withheld for federal income tax.

(iii) Pension withholding (pension): $16.50 or (7.7% of grossPay),

whichever is smaller.

(c) Net pay Gross pay less all deductions.

For each employee, your program would produce an output report in a legible format with each item clearly labelled.

Your program must be capable of processing an arbitrary number of data and should perform reasonable operations for all data sets regardless of how meaningless they are. (For example, what if deductions exceed net pay? What if taxable pay is negative? Be careful to check those and similar situations and decide the appropriate action.)

Verification of the input data is known as an error check. Error checks on the input data are an integral part of every good program. The input data must be checked to make sure that it is valid (within the given ranges). For example: 'Hourly pay rate' must be a non-negative number between 0 and 99.99. You should perform error checks for 'hourly pay rate', 'number of exemptions', and 'hours worked'. You need not check to see that the 'social insurance number' is a 9 digit number.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!