In: Computer Science
programming in Python
weight = float(input("Enter weight in pounds: ")) height = float(input("Enter height in inches: ")) bmi = weight / (height ** 2) print("BMI of the person is " + str(bmi)) if bmi < 19: print("Person is below healthy range.") elif bmi <= 25: print("Person is in healthy range.") else: print("Person is above healthy range.")
year = int(input('Enter year: ')) if year < 1900 or year > 2099: print('Error. Invalid year. Year should be between 1900 and 2099') else: a = year % 19 b = year % 4 c = year % 7 d = (19 * a + 24) % 30 e = (2 * b + 4 * c + 6 * d + 5) % 7 dateOfEaster = 22 + d + e if year in [1954, 1981, 2049, 2076]: dateOfEaster -= 7 if dateOfEaster <= 31: print("Date of easter is March-" + str(dateOfEaster)) else: print("Date of easter is April-" + str(dateOfEaster-31))