CPSC120B
Fundamentals of Computer Science I

Post-lab 2

Variables and Expressions

In this post lab, you will demonstrate your knowledge of variables and expressions by performing an health-oriented computation.

Details

Body Mass Index (BMI) is a measurement devised in the 1800’s, as a way of analyzing an individual’s body shape, as it relates to their height and weight. The BMI of a person is computed by dividing a person’s weight, in kilograms, by the square of the person’s height, in meters.

Create a Python program that when run prints the BMI of a person that is 1.8 meters tall and weighs 81 kilograms. The program must have the following variables:

Example

  $ python3 bmi.py
  The BMI of a person who is 1.8 meters tall and weighs 81 kilograms is 25.0

Submission

Submit your code on the course Inquire site.