BMI Calculator

Task 1

A computer program is being written that will calculate somebody's BMI

Here is the start of the program:

We can simplify the program by designing a function called displayMenu():

We can also design functions to handle each choice:

def getHeight():

This function returns a height value input by the user.

Code this function!

def getWeight():

This function returns a weight value input by the user.

Code this function!

def calculateBMI(height, weight):

This function first checks that height and weight are not 0. If either or both is, an appropriate message is displayed.

Otherwise, it calculates and displays the BMI using the height and weight data.

BMI = weight/height2

Code this function!

Testing

Make sure you are thoughtful when testing your solution.

If your code has a validation check, test your code with acceptable/valid data and unacceptable/invalid data.