Write a C++ program that reads and processes an employee incomefile hw2.dat . Ea
ID: 3617173 • Letter: W
Question
Write a C++ program that reads and processes an employee incomefile hw2.dat. Each record (line) of thefile contains an employee's number (nine digits) and the employee'staxable income (dollars and cents). One record exists for eachemployee.
Your program is to read the input file and produce a tax reportwritten to an output file (you choose its location and name). Thereport shall consist of a line for each employee, each linecontaining the employee's number, taxable income, and the amount oftax payable. Display at the bottom of the report the average amountof tax payable. The amount of tax payable shall be calculatedaccording to the following table.
TaxableIncome Tax Payable
$0 - $4,461.99 None
$ 4,462.00 -$17,893.99 Zero plus 30 cents for eachdollar in excess of
$ 4,462.00
$17,894.00 -$29,499.99 $4,119.00 plus 35 cents for each dollar in excess of
$17,894.00
$29,500.00 -$45,787.99 $8,656.00 plus 46 cents for each dollar in excess of
$29,500.00
$45,788.00 andover $11,179.00 plus 60 cents for each dollar in excess of
$45,788.00
Use a separate function to compute the tax payable.
Explanation / Answer
please rate - thanks #include #include #include using namespace std; double gettax(double); int main() {int num,i=0; double average,sum=0,income,rate,tax; ifstream in; ofstream out; in.open("hw2.dat"); if(in.fail()) { coutincome; tax=gettax(income); sum+=tax; outRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.