write a python program to print the Income, Tax & Surcharge of Employ. The Tax and Surcharge based on
the following conditions
Income Tax% Surcharge
< Rs. 15000 15% 7%
Rs. 15001 to Rs. 20000 18% 11%
Above Rs. 21000 20% 13%
[Total Income =Income- Tax-Surcharge][Tax=Income)/100]. Display all
information like Income, Tax & Surcharge .
Answers
Here are all the details we know and we need to know:
(1) If income is below 15,000, tax = 15% and surcharge = 7%
(2) If income is below 20,000 but above 15,000, tax = 18% and surcharge = 11%
(3) If income is above 20,000, tax = 20% and surcharge = 13%
____________________________________________________
In order to write a code, we will first need to know what the income of a person is.
so, we would just say,
income = float(input('What is your income:'))
Now that we have the income, we will need to check the criteria. As we have 3 criteria to look at, we will be having if-elif-else.
The if is for if the income is below 15,000
Elif is for above 15,000 but below 20,000
and else is for anything which do not meet the above two requirements. That is above 20,000
_______________________________________________________
This is how we will printing out the tax, total income and the surcharge.
We will print the initial income:
Money taken out for tax:
Money taken out for surcharge:
Income:
________________________________________________________
CODE:
________________________________________________
income = float(input('Enter your income:'))
if income < 15000:
tax = 0.15*income
surcharge = 0.07*income
left = income - (tax + surcharge)
print(f'INCOME:{left:.2f}\nTax:{tax:.2f}\nSurcharge:{surcharge:.2f}')
elif income > 15000 and income < 20000:
tax = 0.18*income
surcharge = 0.11*income
left = income - (tax + surcharge)
print(f'INCOME:{left:.2f}\nTax:{tax:.2f}\nSurcharge:{surcharge:.2f}')
else:
tax = 0.20*income
surcharge = 0.13*income
left = income - (tax + surcharge)
print(f'INCOME:{left:.2f}\nTax:{tax:.2f}\nSurcharge:{surcharge:.2f}')
income 15000salary mera account ma aani chahiya