मराठी

Write a program to input employee no, name, basic pay and find HRA, DA and netpay. Basic pay Hra Da >100000 15% 8% <=100000and>50000 10% 5% <=50000 5% 3%

Advertisements
Advertisements

प्रश्न

Write a program to input employee no, name, basic pay and find HRA, DA and netpay.

Basic pay Hra Da
>100000 15% 8%
<=100000&>50000 10% 5%
<=50000 5% 3%
कोड लेखन
Advertisements

उत्तर

Select HRA and DA according to basic pay, then calculate netpay.

employee_no = input("Enter employee no: ")
name = input("Enter name: ")
basic_pay = float(input("Enter basic pay: "))

if basic_pay > 100000:
    hra = basic_pay * 15 / 100
    da = basic_pay * 8 / 100
elif basic_pay > 50000:
    hra = basic_pay * 10 / 100
    da = basic_pay * 5 / 100
else:
    hra = basic_pay * 5 / 100
    da = basic_pay * 3 / 100

netpay = basic_pay + hra + da

print("Employee no:", employee_no)
print("Name:", name)
print("HRA:", hra)
print("DA:", da)
print("Netpay:", netpay)
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1: Review of Phython - EXERCISE [पृष्ठ २६]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
पाठ 1 Review of Phython
EXERCISE | Q 12. | पृष्ठ २६
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×