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 $50,000 up to $75,000 3 percent on the amount over $75,000 up to $100,000 4 percent on the amount over $100,000 up to $250,000 5 percent on the amount over $250,000 up to $500,000 6 percent on the amount over $500,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. Important note: For example, if someone receives $60,000, the tax will be 1% of $50,000 plus 2% of $10,000, which means $700. Name the program file tax.cpp Sample output: Enter yearly income amount (0.0 to quit): $ 45000.00 The U.S. 1913 income tax = $450.00 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.00 The U.S. 1913 income tax = $3050.00 Enter yearly income amount (0.0 to quit): $ 382000.00 The U.S. 1913 income tax = $14350.00 Enter yearly income amount (0.0 to quit): $ 1000000.00 The U.S. 1913 income tax = $50250.00 Enter yearly income amount (0.0 to quit): $ 0.00 Processing completed...

Solution

#include <iostream>
using namespace std;

int main()
{
   double ans=0;
   double amt;
   while(true)
   {
       ans=0;
       cout<<\"Enter early income amount(0.0 to quit): $\";
       cin>>amt;
      
       if(amt==0)
       {
           break;
       }
       if(amt>50000)
       {
           ans += 50000*0.01;
           if(amt>75000)
           {
               ans += 25000*0.02;
               if(amt>100000)
               {
                   ans += 25000*0.03;
                   if(amt>250000)
                   {
                       ans += 150000*0.04;
                       if(amt>500000)
                       {
                           ans += 250000*0.05;
                           ans += (amt-500000)*0.06;
                       }
                       else
                       {
                           ans += (amt-250000)*0.05;
                       }
              
                   }
                   else
                   {
                       ans += (amt-100000)*0.04;
                   }
               }
               else
               {
                   ans += (amt-75000)*0.03;
               }
           }
           else
           {
               ans += (amt-50000)*0.02;
           }
       }
       else
       {
           ans += amt*0.01;
       }
       //ans = ans*1000;
       cout<<\"The U.S. 1913 income tax = $\"<<ans<<endl;
   }
   cout<<\"Processing completed...\"<<endl;
   return 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 $50,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 $50,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