Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
33 views5 pages

ConditionalStatement Program From 11 15

The document contains multiple programming tasks related to tax calculation, bank deposit maturity, insurance policy discounts, employee salary allowances, and temperature conversion. Each task includes a description of the problem, input requirements, and the corresponding Python code to solve it. The code examples demonstrate how to implement the logic for each scenario using conditional statements and calculations.

Uploaded by

kalpanapriyam213
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views5 pages

ConditionalStatement Program From 11 15

The document contains multiple programming tasks related to tax calculation, bank deposit maturity, insurance policy discounts, employee salary allowances, and temperature conversion. Each task includes a description of the problem, input requirements, and the corresponding Python code to solve it. The code examples demonstrate how to implement the logic for each scenario using conditional statements and calculations.

Uploaded by

kalpanapriyam213
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Question 11

Given below is a hypothetical table showing rate of income tax for an India citizen, who is below or up to 60 years.

Taxable income (TI) in ₹ Income Tax in ₹


Up to ₹ 2,50,000 Nil
More than ₹ 2,50,000 and less than or equal to ₹ 5,00,000 (TI - 1,60,000) * 10%
More than ₹ 5,00,000 and less than or equal to ₹ 10,00,000 (TI - 5,00,000) * 20% + 34,000
More than ₹ 10,00,000 (TI - 10,00,000) * 30% + 94,000
Write a program to input the name, age and taxable income of a person. If the age is more than 60 years then display
the message
"Wrong Category". If the age is less than or equal to 60 years then compute and display the
income tax payable along with the name of tax payer, as per the table given above.

# Input name, age and taxable income


name = input("Enter name of the taxpayer: ")
age = int(input("Enter age of the taxpayer: "))
taxable_income = float(input("Enter taxable income (₹): "))

# Check age category


if age > 60:
print("Wrong Category")
else:
# Calculate tax based on taxable income slabs
if taxable_income <= 250000:
tax = 0
elif taxable_income <= 500000:
tax = (taxable_income - 160000) * 0.10
elif taxable_income <= 1000000:
tax = (taxable_income - 500000) * 0.20 + 34000
else:
tax = (taxable_income - 1000000) * 0.30 + 94000

# Display tax payer details and tax payable


print(f"\nTaxpayer Name: {name}")
print(f"Income Tax Payable: ₹ {tax:.2f}")

Question 12
An employee wants to deposit certain sum of money under 'Term Deposit' scheme in Syndicate Bank.
The bank has provided the tariff of the scheme, which is given below:

No. of Days Rate of Interest


Up to 180 days 5.5%
181 to 364 days 7.5%
Exact 365 days 9.0%
More than 365 days 8.5%
Write a program to calculate the maturity amount taking the sum and number of days as inputs.

# Input sum deposited and number of days

principal = float(input("Enter the sum to be deposited: ₹ "))

days = int(input("Enter the number of days: "))

# Determine rate of interest based on number of days

if days <= 180:

rate = 5.5

elif days <= 364:

rate = 7.5

elif days == 365:

rate = 9.0

else:

rate = 8.5

# Calculate maturity amount using simple interest formula:

# Maturity Amount = Principal + (Principal * Rate * Time)

# Time is in years, so days / 365

time_in_years = days / 365

interest = (principal * rate * time_in_years) / 100

maturity_amount = principal + interest

# Display maturity amount

print(f"\nMaturity Amount: ₹ {maturity_amount:.2f}")

Question 13
Mr. Kumar is an LIC agent. He offers discount to his policy holders on the annual premium.
However, he also gets commission on the sum assured as per the given tariff.

Sum Assured Discount Commission


Up to ₹ 1,00,000 5% 2%
₹ 1,00,001 and up to ₹ 2,00,000 8% 3%
₹ 2,00,001 and up to ₹ 5,00,000 10% 5%
More than ₹ 5,00,000 15% 7.5%
Write a program to input name of the policy holder, the sum assured and first annual premium.
Calculate the discount of the policy holder and the commission of the agent. The program displays all the details as:
Name of the policy holder :
Sum assured :
Premium :
Discount on the first premium :
Commission of the agent :

# Input details
name = input("Enter name of the policy holder: ")
sum_assured = float(input("Enter sum assured (₹): "))
premium = float(input("Enter first annual premium (₹): "))

# Initialize discount and commission rates


if sum_assured <= 100000:
discount_rate = 5
commission_rate = 2
elif sum_assured <= 200000:
discount_rate = 8
commission_rate = 3
elif sum_assured <= 500000:
discount_rate = 10
commission_rate = 5
else:
discount_rate = 15
commission_rate = 7.5

# Calculate discount and commission


discount = (discount_rate / 100) * premium
commission = (commission_rate / 100) * sum_assured

# Display the results


print("\n--- LIC Policy Summary ---")
print(f"Name of the policy holder : {name}")
print(f"Sum assured : ₹ {sum_assured:.2f}")
print(f"First annual premium : ₹ {premium:.2f}")
print(f"Discount on the first premium : ₹ {discount:.2f}")
print(f"Commission of the agent : ₹ {commission:.2f}")
Question 14
A company announces revised Dearness Allowance (DA) and Special Allowances (SA) for their employees as per the
tariff given below:

Basic Dearness Allowance (DA) Special Allowance (SA)


Up to ₹ 10,000 10% 5%
₹ 10,001 - ₹ 20,000 12% 8%
₹ 20,001 - ₹ 30,000 15% 10%
₹ 30,001 and above 20% 12%
Write a program to accept name and Basic Salary (BS) of an employee. Calculate and display gross salary.
Gross Salary = Basic + Dearness Allowance + Special Allowance
Print the information in the given format:
Name Basic DA Spl. Allowance Gross Salary
xxx xxx xxx xxx xxx

# Input details
name = input("Enter name of the Employee: ")
basic = float(input("Enter Basic (₹): "))

# Initialize discount and commission rates


if basic <= 10000:
da = 10
sa = 5
elif basic <= 20000:
da = 12
sa = 8
elif basic <= 30000:
da = 15
sa = 10
else:
discount_rate = 20
commission_rate = 12

da_in_amount = (da/100.0)*basic
sa_in_amount = (sa/100.0)*basic
# Calculate of Gross Salary
GrossSalary = basic + da_in_amount + sa_in_amount

# Display the results


print("\n--- LIC Policy Summary ---")
print(f"Name of the policy holder : {name}")
print(f"Basic : ₹ {basic}")
print(f"Dearness Allowance : ₹ {da_in_amount}")
print(f"Special Allowance : ₹ {sa_in_amount}")
print(f"Gross Salary : ₹ {GrossSalary}")

Question 15

Using a switch case statement, write a menu driven program to convert a given temperature from

Fahrenheit to Celsius and vice-versa. For an incorrect choice, an appropriate message should be displayed.

Hint: c = 5/9*(f-32) and f=1.8*c+32

print("Temperature Converter Menu")

print("1. Fahrenheit to Celsius")

print("2. Celsius to Fahrenheit")

choice = int(input("Enter your choice (1 or 2): "))

match choice:

case 1:

f = float(input("Enter temperature in Fahrenheit: "))

c = (5 / 9) * (f - 32)

print(f"Temperature in Celsius: {c:.2f}°C")

case 2:

c = float(input("Enter temperature in Celsius: "))

f = 1.8 * c + 32

print(f"Temperature in Fahrenheit: {f:.2f}°F")

case _:

print("Invalid choice! Please enter 1 or 2.")

You might also like