Question: processing structs Write a C++ program that accepts 4 pieces of data [ID Number, # of hours worked, hourly pay rate, and a percentage (12

processing structs

Write a C++ program that accepts 4 pieces of data [ID Number, # of hours worked, hourly pay rate, and a percentage (12 = 12% = 0.12) for the tax deduction ] for an employee and then computes and prints the employees net pay.

The data should be stored in an array of structs of the following structure type:

Struct EmployeeType

{

int idNum,

hoursWorked;

float hourlyPayRate;

float taxRate;

}

Turn in printouts for the data below:

ID Hours Worked Rate Of Pay Tax Rate(%)

1086 40 6.50 10

1125 35 12.00 15

2344 40 66.00 28

9972 60 45.00 28

3446 20 9.75 10

A typical line of output should appear as:

ID Hours Worked Rate Of Pay Tax Rate Gross Pay Net Pay

1086 40 6.50 10 $260.00 $234.00

Please create a loop in your code so all data can be entered in a single run. After all data is entered in the array use another loop to print the 5 lines of output. Output MUST be formatted identically to the line above.

for producing output: Write the 6 lines of output (one header line followed by 5 data lines) to a text file, then copy the text file content to your turn in document.

#include

ofstream outfile("output.txt");

Now use outfile like you have been using cout and it writes to the file instead of the screen

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!