The original US income tax of 1913 was quite simple The tax

The original U.S. income tax of 1913 was quite simple. The tax was: 1 percent on the first $50,000 2 percent on the amount over S50,000 up to $75,000 3 percent on the amount over $75,000 up to $ 100,000 4 percent on the amount over S100,000 up to S250,000 5 percent on the amount over $250,000 up to S500,000 6 percent on the amount over S500,000 Write a program that will accept income amounts, one at a time, and compute the 1913 income tax according to this schedule using a multi-way if. else. When the user enters 0. 0, it means that there are no more amounts to process.

Solution

#include<iostream>
using namespace std;
int main()
{
    double amt, per;
    //Loops till 0.0 is entered as amount
    do
    {
        cout<<\"\ Enter yearly income amount (0.0 to quit): \";
        cin>>amt;
        //Checks less than or equal to 50000
        if(amt <= 50000)
            per = amt * .01;
        //Checks between 50000 and 75000
        else if (amt <= 75000)
            per = (50000 * .01) + (amt - 50000) * .02;
        //Checks between 75000 and 100000
        else if(amt <= 100000)
                per = (50000 * .01) + (25000 * .02) + (amt - 75000) * .03;
        //Checks between 100000 and 250000
        else if(amt <= 250000)
                per = (50000 * .01) + (25000 * .02) + (25000 * .03) + (amt - (100000)) * .04;
        //Checks between 250000 and 500000
        else if(amt <= 500000)
                per = (50000 * .01) + (25000 * .02) + (25000 * .03) + (150000 * .04) + (amt - (250000)) * .05;
        //Above 500000
        else
                per = (50000 * .01) + (25000 * .02) + (25000 * .03) + (150000 * .04) + (250000 * .05) + (amt - (500000)) * .06;
        //If amount is not 0.0 then display the percent
        if(amt != 0.0)
        cout<<\"\ The U.S. 1913 income tax = $\"<<per;
    }while(amt != 0.0);
    cout<<\"\ Process completed ...\";
}


Output:
Enter yearly income amount (0.0 to quit): 45000

The U.S. 1913 income tax = $450
Enter yearly income amount (0.0 to quit): 53275.98

The U.S. 1913 income tax = $565.52
Enter yearly income amount (0.0 to quit): 132500

The U.S. 1913 income tax = $3050
Enter yearly income amount (0.0 to quit): 382000

The U.S. 1913 income tax = $14350
Enter yearly income amount (0.0 to quit): 1000000

The U.S. 1913 income tax = $50250
Enter yearly income amount (0.0 to quit): 0.0

 The original U.S. income tax of 1913 was quite simple. The tax was: 1 percent on the first $50,000 2 percent on the amount over S50,000 up to $75,000 3 percent
 The original U.S. income tax of 1913 was quite simple. The tax was: 1 percent on the first $50,000 2 percent on the amount over S50,000 up to $75,000 3 percent

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site