income and withheld tax amount (paid tax amount). Your program then calculates the actual tax amount
the user should be paying based on the following tax table:
Tax Bracket Married Filing Jointly Single
10% Bracket $0 – $17,400 $0 – $8,700
15% Bracket $17,401 – $70,700 $8,701 – $35,350
25% Bracket $70,701 – $142,700 $35,351 – $85,650
28% Bracket $142,701 – $217,450 $85,651 – $178,650
33% Bracket $217,451 – $388,350 $178,651 – $388,350
35% Bracket Over $388,350 Over $388,350
Your program then shows the user his/her refund or the amount of tax he/she owes.
+ All output numeric values are right-justified.
+ User must be given a choice whether to repeat/re-run or to terminate the proram.
Below is what I have so far, I am haveing trouble trying to figure out how to set up the tax table so it will give the amount due or refund amount.
[ tax calculator
Algo: ....
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
//Define variables used in the program
//variable used to save users income
string fileStatus;
//variable used to save withheld tax
string taxPaid;
//define output file variable
ofstream outputFile;
//initialize file output variable
outputFile.open("myTaxForm.txt");
//Define input file varialbe
ifstream inputFile;
//Implementation of the algorithm defined above
//Ask user to input file status and withheld tax amount
cout<<"Enter the file status of the user:"<<endl;
cin>>fileStatus;
cout<<"Enter the tax paid amount of the user:"<<endl;
cin>>taxPaid;
//Write user’s info to the file
outputFile <<fileStatus<<"\t"<<taxPaid<<"\n";
return 0;
}
]
This post has been edited by jimblumberg: 27 March 2012 - 07:21 AM
Reason for edit:: Added missing Code Tags, Please learn to use them.

New Topic/Question
Reply



MultiQuote



|