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:
This function returns a height value input by the user.
This function returns a weight value input by the user.
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.
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.