In: Computer Science
Ask the user for W2 income amount, any interest, deduction and
paid tax amount. Calculate the actual tax amount based upon the
given income and data . Continuously ask the user to enter another
set of data until the user chooses to exit the program
Requirements:
1. The program must produce similar output.
2. The tax rate is 25% for total income that is less than or equal 10000 and 50% otherwise.
3. The tax amount is calculated based upon the actual income (income + interest – deduction)
4. Print out “due” or “refund” based upon the proper tax amount result
#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
int main() {
   //Declaring variables
double income,deductions,tax,amt;
   double interestrate;
  
   cout<<"Enter the income (<=0 to exit)
:$";
   cin>>income;
   while(income>0)
   {
       cout<<"Enter Interest
rate:%";
       cin>>interestrate;
      
       cout<<"Enter Amount of
deductions :$";
       cin>>deductions;
      
      
amt=(income+income*(interestrate/100))-deductions;
       if(amt<10000)
       {
          
tax=amt*.25;
       }
       else
       {
          
tax=amt*.50;
       }
      
       cout<<"Tax amount is
:$"<
   cout<<"\n\nEnter the income (<=0 to exit)
:$";
   cin>>income;
   }   
   return 0;
}
output:
