An IRS agent is checking taxpayer’s returns in the $20,000.00 to $30,000.00 income bracket (gross earnings). Each record of the data file contains a tax identification number (four digits), gross earnings, and the amount of taxes paid for the year. If the taxes paid are below 18.5% of the gross earnings, you are to compute the taxes due (assume all taxes are in the bracket of 18.5% of gross earnings). If there are taxes due a penalty charge of 4% is added to the amount. If the taxes due exceed $1,400.00 an additional 1.0% penalty charge is added to the amount over $1,400.00. For those that paid more than the 18.5%, compute the refund due and leave a message to that effect. Records of gross earnings outside the range of $20,000.00 to $30,000.00 are not checked and an appropriate message must be printed to that effect.
Your program must also generate a summary report containing the following information:
1. The total number of records in the data file.
2. The total number of taxpayer’s checked in range.
3. The total number of taxpayer’s receiving refunds.
4. The total dollar amount refunded.
5. The total number of taxpayer’s that owe taxes.
6. The total dollar amount of taxes due.
7. The total dollar amount of penalties due.
8. The average dollar amount refunded.
9. The average dollar amount of taxes due.
10. The average dollar amount of the penalties due.
Note: You must use functions for the following:
1. The headings.
2. One function to compute the averages. (called three times)
3. Print the summary report.
4. Other functions may be used were you deemed appropriate.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include <iostream>
#include <fstream>
using namespace std;
void heading();
void averagepaid();
int main()
{
int counter = 0, idno = 0;
double income = 0.0, tax = 0.0;
ifstream f1 ("h:\\fall 2014\\irsdata.txt",ios::in);
heading();
while (f1>>idno>>income>>tax, !f1.eof())
{
counter++;
cout<< counter<<" "<<idno<<" "<<income<<" "<< tax<<" ";
if(income >= 20000 && income <= 30000)
cout << " in range "<< endl;
else
cout << " out of range "<< endl;
}
f1.close(); return 0;
}
void heading()
{ cout << " \n\n Assignment # 4 \n";
cout << " By: Austin Adkison \n"
<< " Due Date : October 13, 2014 \n\n";
}
void averagepaid
{
}
|
Within the irsdata.txt is
5647 28500.00 6547.19
9087 21500.00 2975.50
1245 18750.00 2812.50
3421 27500.00 00.00
9700 26250.00 6150.00
2367 23100.00 950.00
2356 21100.00 3975.50
7757 19850.00 3672.90
6656 22500.00 4000.00
2443 20010.00 3012.85
5124 30196.00 5747.24
5994 20575.00 4255.10
3331 24180.00 4170.00
5199 75150.00 26256.00
3995 29995.00 3175.50
8321 6010.00 901.00
I guess what im asking to do, is where to go from here, because the professor doesn't teach what he gives us to do half the time.