This Python program reads the base salary of an employee and calculates deductions for insurance and tax.
It then computes the net income after these deductions.
The code is formatted for smooth integration into a webpage using the specified HTML structure.
salary = float(input("Please enter the base salary (in Toman): "))
insurance_rate = 0.07 # 7% insurance
tax_rate = 0.10 # 10% tax
insurance = salary * insurance_rate
tax = salary * tax_rate
net_income = salary - insurance - tax
print("Insurance amount:", insurance)
print("Tax amount:", tax)
print("Net income:", net_income)
Please enter the base salary (in Toman): 10000000
Insurance amount: 700000.0
Tax amount: 1000000.0
Net income: 8300000.0
Here’s how the program works:
- It assumes an insurance rate of 7%
and a tax rate of 10%
- The insurance and tax amounts are calculated by multiplying the base salary by their respective rates
- The net income is calculated by subtracting both deductions from the base salary
- The results are displayed using the print()
function