Question

In: Computer Science

programming in Python The body mass index (BMI) is calculated as a person’s weight (in lb)...

programming in Python

  1. The body mass index (BMI) is calculated as a person’s weight (in lb) times 720, divided by the square of the person’s height (in inches). A BMI in the range 19-25, inclusive, is considered healthy. Write a program that inputs people’s weight and height, then calculates a person’s BMI and print a message telling whether they are above, within, or below the healthy range.
  2. A formula for computing Easter in the years 1982-2048, inclusive, is as follows: let a=year%19, b=year%4, c=year%7, d=(19a+24)%30, e=(2b+4c+6d+5)%7. The date of Easter is March 22+d+e (which could be in April). Write a program that inputs a year, verifies that it is in the proper range, and then prints out the date of that year.

Solutions

Expert Solution

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))

Related Solutions

The Body Mass Index (BMI) is a value calculated based on the weight and the height...
The Body Mass Index (BMI) is a value calculated based on the weight and the height of an individual. In a small European city, a survey was conducted one year ago to review the BMI of the citizens. In the sample 22 with 200 citizens, the mean BMI was 23.3 kg/m and standard deviation was 1.5 kg/m . It is reasonable to assume the BMI distribution is a normal distribution. (a) Find the point estimate of the population mean BMI...
The Body Mass Index (BMI) is a value calculated based on the weight and the height...
The Body Mass Index (BMI) is a value calculated based on the weight and the height of an individual. In a small European city, a survey was conducted one year ago to review the BMI of the citizens. In the sample with 200 citizens, the mean BMI was 23.3 kg/m2 and standard deviation was 1.5 kg/m2 . It is reasonable to assume the BMI distribution is a normal distribution. (a) Find the point estimate of the population mean BMI one...
The Body Mass Index (BMI) is a calculation used to categorize whether a person’s weight is...
The Body Mass Index (BMI) is a calculation used to categorize whether a person’s weight is at a healthy weight for a given height. The formula is as follows:                 bmi = kilograms / (meters2)                 where kilograms = person’s weight in kilograms, meters = person’s height in meters BMI is then categorized as follows: Classification BMI Range Underweight Less than 18.5 Normal 18.5 or more, but less than 25.0 Overweight 25.0 or more, but less than 30.0 Obese 30.0...
Question 2 The Body Mass Index (BMI) is a value calculated based on the weight and...
Question 2 The Body Mass Index (BMI) is a value calculated based on the weight and the height of an individual. In a small European city, a survey was conducted one year ago to review the BMI of the citizens. In the sample with 200 citizens, the mean BMI was 23.3 kg/m2 and standard deviation was 1.5 kg/m2 . It is reasonable to assume the BMI distribution is a normal distribution. (a) Find the point estimate of the population mean...
please show work Body mass index (BMI) is computed as the ratio of weight in kilograms...
please show work Body mass index (BMI) is computed as the ratio of weight in kilograms to the square of the height in meters.  The distribution of BMI is approximately normal for females aged 30-39. In this group, the mean BMI is 24.5, with a standard deviation of 3.3. 13) What proportion of females aged 30-39 has a BMI of 25 or more? 14) Persons with a BMI of 30 or greater are considered obese.  What proportion of females aged 30-39 is...
Discuss the process of calculating Body Mass Index (BMI).
Discuss the process of calculating Body Mass Index (BMI).
The body mass index​ (BMI) for a sample of men and a sample of women are...
The body mass index​ (BMI) for a sample of men and a sample of women are given below. Assume the samples are simple random samples obtained from populations with normal distributions. Men 30.930.9 22.322.3 29.929.9 30.930.9 27.227.2 31.731.7 26.526.5 20.220.2 26.626.6 30.530.5 Women nbspWomen 18.218.2 20.720.7 22.222.2 28.428.4 17.117.1 20.320.3 23.923.9 31.831.8 20.820.8 20.720.7 LOADING... Click the icon to view the table of​ Chi-Square critical values. a. Construct aa 9090​% confidence interval estimate of the standard deviation of BMIs for...
Design a modular program that calculates and displays a person's body mass index (BMI). The BMI...
Design a modular program that calculates and displays a person's body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is overweight or underweight for his or her height. A person's BMI is calculated with the following formula: BMI=Weight*703/Height^2. I need help making this to Java to just calculate BMI.
Body mass index (BMI) is a reliable indicator of body fat for most children and teens....
Body mass index (BMI) is a reliable indicator of body fat for most children and teens. BMI is calculated from a child’s weight and height and is used as an easy-to-perform method of screening for weight categories that may lead to health problems. For children and teens, BMI is age- and sex-specific and is often referred to as BMI-for-age. The Centers for Disease Control and Prevention (CDC) reports BMI-for-age growth charts for girls as well as boys to obtain a...
We claim that the body mass index (BMI) for men is statistically the same as the...
We claim that the body mass index (BMI) for men is statistically the same as the BMI for women. Data from a random sample of 40 men and 40 women is presented below: BMI-M BMI-F Mean 25.9975 Mean 25.74 Standard Error 0.542448 Standard Error 0.974862 Median 26.2 Median 23.9 Mode 23.8 Mode 19.6 Standard Deviation 3.430742 Standard Deviation 6.16557 Sample Variance 11.76999 Sample Variance 38.01426 Kurtosis -0.13645 Kurtosis 1.517743 Skewness 0.356785 Skewness 1.189501 Range 13.6 Range 27.2 Minimum 19.6 Minimum...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT