Salary Slip (Basic + Allowances - Deductions) Dry Run in PYTHON

Salary Slip (Basic + Allowances - Deductions) is an interactive PYTHON dry run visualizer from the Io programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Salary Slip (Basic + Allowances - Deductions) Program Code

# Salary Slip Generator
basic = float(input("Enter Basic Salary: "))

# Allowances (percentages of basic)
hra = basic * 0.20
da = basic * 0.15
ta = basic * 0.10
other_allowances = basic * 0.05

# Deductions
pf = basic * 0.12
tax = basic * 0.10
other_deductions = basic * 0.03

# Calculations
gross_salary = basic + hra + da + ta + other_allowances
total_deductions = pf + tax + other_deductions
net_salary = gross_salary - total_deductions

# Display Salary Slip
print("\n" + "="*40)
print("         SALARY SLIP")
print("="*40)
print(f"Basic Salary:      ₹{basic:10.2f}")
print(f"HRA (20%):         ₹{hra:10.2f}")
print(f"DA (15%):          ₹{da:10.2f}")
print(f"TA (10%):          ₹{ta:10.2f}")
print(f"Other Allowances:  ₹{other_allowances:10.2f}")
print("-"*40)
print(f"GROSS SALARY:      ₹{gross_salary:10.2f}")
print("-"*40)
print(f"PF (12%):          ₹{pf:10.2f}")
print(f"Tax (10%):         ₹{tax:10.2f}")
print(f"Other Deductions:  ₹{other_deductions:10.2f}")
print("-"*40)
print(f"TOTAL DEDUCTIONS:  ₹{total_deductions:10.2f}")
print("-"*40)
print(f"NET SALARY:        ₹{net_salary:10.2f}")
print("="*40)

View the complete Io programs page.

Program Console Salary Slip (Basic + Allowances - Deductions) Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.