In: Accounting
what is the flowchart in RAPTOR for the following:
Write a program that allows a tax accountant to compute personal income tax. Your program will ask for a filing status (0 for single, 1 for married filing jointly, 2 for married filing separately) and a taxable income. The program will compute the tax. Please use the following chart to find the tax rate to use to compute the tax: (0) Single: o $0 - $33,950 --> 10% o $33,951 - $171,550 --> 25% o $171,551 + --> 33% (1) Married Filing Jointly: o $0 - $67,900 --> 10% o $67,901 - $208,850 --> 25% o $208,850 + --> 33% (2) Married Filing Separately: o $0 - $38,950 --> 10% o $38,951 - $104,425 --> 25% o $104,426 + --> 33% The program should run and allow for as many entries as the tax accountant wants to enter. It will process the personal income tax for each person as well as calculate the average income tax for all the individuals entered. The program
copy to code:
#include <iostream>
using namespace std;
int main()
{
int filingStatus=0;
float totalIncomeTax=0;
float currentTax=0;
float totalRecord=0;
do{
cout<<"\nPlease enter filing status"<<endl;
cout<<"Enter 0 for single"<<endl;
cout<<"Enter 1 for married filing jointly"<<endl;
cout<<"Enter 2 for married filing separately"<<endl;
cout<<"Enter -1 to exit"<<endl;
cin>>filingStatus;
if(filingStatus==0 || filingStatus==1 ||filingStatus==2){
cout<<"Enter the taxable income :";
float income;
cin>>income;
currentTax = 0;
totalRecord++;
if(filingStatus==0){
if(income>0 && income<=33950){
currentTax = income*10/100;
}else if(income>=33951 && income<=171550){
currentTax = income*25/100;
}else if(income>=171551){
currentTax = income*33/100;
}
}else if(filingStatus==1){
if(income>0 && income<=67900){
currentTax = income*10/100;
}else if(income>=67901 && income<=208850){
currentTax = income*25/100;
}else if(income>=208851){
currentTax = income*33/100;
}
}else if(filingStatus==2){
if(income>0 && income<=38950 ){
currentTax = income*10/100;
}else if(income>=38951 && income<=104425 ){
currentTax = income*25/100;
}else if(income>=104426 ){
currentTax = income*33/100;
}
}
cout<<"For income "<<income<<" tax is "<<currentTax;
totalIncomeTax+=currentTax;
}
}while(filingStatus!=-1);
cout<<"Tota record entered : "<<totalRecord<<endl;
cout<<"Average income tax is "<<totalIncomeTax/totalRecord;
return 0;
}