Computer Science, asked by divya11111153, 7 months ago

Wap to input the name , age and salary of a person, calculate and display the insurance premium as follows

Age(Years) Premium(% of salary)
20-35 8
36-50 10
51 above 14

Please answer I will u as brainliest and give 10 thanks for your answers......​

Answers

Answered by Equestriadash
3

The following co‎des have been written using Python.

#obtaining the details

n = input("Enter your name: ")

a = int(input("Enter your age: "))

s = float(input("Enter your salary: "))

#testing the requirements and calculating accordingly

if a >= 20 and a <= 35:

   ip = 0.08*s

elif a >= 36 and a <= 50:

   ip = 0.10*s

elif a >= 51:

   ip = 0.14*s

#displaying the output

print(ip, "is your insurance premium.")

Sample output:

Enter your name: Vanessa

Enter your age: 24

Enter your salary: 5000

400.0 is your insurance premium.

Similar questions