Develop an algorithm for the following problem statement. Your solution should be a pseudocode with appropriate comments. You should use modularisation in your solution and provide appropriate error messages (15 marks).
Design a program that receives user height in cm and weight in kg and calculates BMI (body mass index). This program should then print the BMI result and a message based on the following table:
BMI Result Message
BMI = > 25.0 Oops, you are overweight.
18.5 <= BMI < 25 Congrats, you are healthy.
BMI < 18.5 Oops, you are underweight.
Body Mass Index formula is BMI = kg/m2 where kg is a person's weight in kilograms and m2 is their height in metres squared.
Weight should be in kilograms (Minimum 1kg, Maximum 160kg), Height should be in centimetre (Minimum 30cm, Maximum 220cm).
Note: for calculating metres squared(m2), centimetre should be converted to metre then powered by 2.
input: 57 kg 162cm
output: Congrats, you are healthy. Your BMI is 22
Recently Asked Questions
- I could use some pointers on how to get started with an R Code Assignment. 65. How could random variables with the following density function be generated from
- 1.)Which of the following specifically refers to a situation where a third party, outside the transaction, suffers from a market transaction by others? A.)
- The stock of United Industries has a beta a 1.26 and an expected return of 11.8. The risk-free rate of return is 5 percent. What is the expected return on the