Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a C++ program that calculates salary income tax.The ethiopian salary inco

ID: 3784422 • Letter: C

Question

Create a C++ program that calculates salary income tax.The ethiopian salary income uses a progressive taxing system (the tax increases as the taxable amount increases)

rate percentage               salary range
0                                            0-600
10                                            601-1650
15                                             1651-3200
20                                             3201-5250
25                                              5251-7800
30                                           7801-10900
35                                          over 10900

Explanation / Answer

#include<bits/stdc++.h>
using namespace std;


int main(int argc, char const *argv[])
{
   cout<<"Enter yor salary ";
   int sal,tax;

   cin>>sal;

   if(sal<=600)
   {
       tax=sal*0/100;
   }
   else if(sal>=601 &&sal<=1650)
   {       tax=sal*10/100;


   }else if(sal>=1651 &&sal<=3200)
   {       tax=sal*15/100;

      
   }else if(sal>=3201 &&sal<=5250)
   {       tax=sal*20/100;

      
   }else if(sal>=5251 &&sal<=7800)
   {
               tax=sal*25/100;

   }else if(sal>=7801 &&sal<=10900)
   {
               tax=sal*30/100;

   }
   else
   {       tax=sal*35/100;


   }
   cout<<"Yor tax is "<<tax<<endl;
   return 0;
}

====================================

Output:

akshay@akshay-Inspiron-3537:~$ g++ salary.cpp
akshay@akshay-Inspiron-3537:~$ ./a.out
Enter yor salary
600
Yor tax is 0