Friday, February 1, 2019

Body Mass Index

  • Problem Description

    Write a program that computes the body mass index (BMI) of an individual. 

    Your program should begin by reading a height and weight from the user. If you read the height in meters and the weight in kilograms then body mass index is computed using this slightly simpler formula:

    BMI = weight / height *height

    Use round function in the final output value
  • CODING ARENA
  • a=float(input())
    b=int(input())
    c=b/(a*a)
    print("The BMI IS",round(c,2))
  • Test Case 1

    Input (stdin)
    1.69
    
    64
    
    
    Expected Output
    The BMI IS 22.41
  • Test Case 2

    Input (stdin)
    1.72
    
    71
    
    
    Expected Output
    The BMI IS 24.0

No comments:

Post a Comment