IF Else
Q1- The body mass index (BMI) is computed by taking the individual's
weight (mass) in kilograms and dividing it by the square of their height in
meters. a. Show the category of the person depending on BMI value
(Note convert Height value in meter)
Formula- meters=feet×0.3048
INPUT
w=int(input("Enter your Weight:"))
h=float(input("Enter your height:"))
h1=h*0.3048
print("Converted value in meeter:",h1)
bmi=w/(h1*h1)
if bmi<18.5:
print("Under Weight")
elif bmi>=18.5 and bmi<=24.9:
print("Normal Weight")
elif bmi>=24.5 and bmi<=29.9:
print("Over Weight")
elif bmi>=30:
print("OBESE")
OUTPUT
RAPTOR
Q2- In the supermarket there is an offer, if your bill is more than 500 AED
you get 10% of discount, if it is more than 1000AED then you get 15% of
discount, for all purchase above 2000AED you get 20%of discount.
Calculate the final bill amount.
INPUT
bill = int (input("What is the bill amount? "))
dis_a = 10/100
dis_b = 15/100
dis_c = 20/100
dis_d = 50/100
if bill >= 5000:
newamount = bill - (bill * dis_d)
elif bill >= 2000:
newamount = bill - (bill * dis_c)
elif bill >= 1000:
newamount = bill - (bill * dis_b)
elif bill >= 500:
newamount = bill - (bill * dis_a)
else:
print ("Sorry, no discount will be given.\n")
print ("***************************")
print ("The bill amount is: ",bill)
print ("***************************")
exit()
print ("***************************")
print ("The original bill amount was: ",bill)
print ("The amount of cashback you got: ",(bill-newamount))
print ("The new bill amount is",newamount)
print ("***************************")
OUTPUT
RAPTOR