Question: Hello I am using a grading software called zybooks but I am having problems with outputs 1,2,3,4,and 25 to be correct. Any help would be

Hello I am using a grading software called zybooks but I am having problems with outputs 1,2,3,4,and 25 to be correct. Any help would be appreciated

Code:

#include #include #include #include using namespace std; const int NUM_BRACKETS=7;

//Tax rates double rates[]={0.10,0.12,0.22,0.24,0.32,0.35,0.37};

//Tax limit and base tax for single tax payers double singleLimits[]={0,9525,38700,82500,157500,200000,500000}; double singleTaxBase[]={0,952.5,4453.50,14089.50,32089.50,45689.50,150689.50};

//Tax limit and base tax for married taxpayers filing tax jointly double jointLimits[]={0,19050,77400,165000,315000,400000,600000}; double jointTaxBase[]={0,1905,8907,28179,64179,91379,161379};

//Tax limit and base tax for married taxpayers filing tax separately double separateFilingLimits[]={0,9525,38700,82500,157500,200000,300000}; double separateFilingTaxBase[]={0,952.50,4453.50,14089.50,32089.50,45689.50,150689.50};

//Tax limit and base tax for household head double headLimits[]={0,13600,51800,82500,157500,200000,500000}; double headTaxBase[]={0,1360,5944,12696,30696,44298,149298};

/* This function accepts the taxable amount,the tax limits and taxbase and compute the tax and returns to the main() */

double computeTax(double taxableAmount,double limits[],double taxBase[]) { double tax; int i=0; //the while loop finds the appropriate index for the given taxable amount while(taxableAmount>=limits[i]) i++; //compute the tax tax=taxBase[i-1] + (taxableAmount-limits[i-1])*rates[i-1]; return tax; } int main() { string status=""; double taxableamount=0,tax=0; cout>status;

cout>taxableamount;

if(status=="X") tax=computeTax(taxableamount,singleLimits,singleTaxBase); else if(status=="Y1") tax=computeTax(taxableamount,jointLimits,jointTaxBase);

else if(status=="Y2") tax=computeTax(taxableamount,separateFilingLimits,separateFilingTaxBase); else if(status=="Z") tax=computeTax(taxableamount,headLimits,headTaxBase); cout

return 0; }Hello I am using a grading software called zybooks but I amhaving problems with outputs 1,2,3,4,and 25 to be correct. Any help wouldbe appreciated Code: #include #include #include #include using namespace std; const intNUM_BRACKETS=7; //Tax rates double rates[]={0.10,0.12,0.22,0.24,0.32,0.35,0.37}; //Tax limit and base tax for single

6.12 Tax Computation Review the following code to understand how the arrays are passed to functions. #include using namespace std; //assumes both arrays are of same size. int dot Product (int arrayone[], int arrayTwo [], int count) { int total = 0; for (int i=0; i using namespace std; //assumes both arrays are of same size. int dot Product (int arrayone[], int arrayTwo [], int count) { int total = 0; for (int i=0; i

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 Accounting Questions!