Answered You can hire a professional tutor to get the answer.

QUESTION

Develop an algorithm for the following problem statement. Your solution should be a pseudocode with appropriate comments.

3.

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:

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.

For example:

input: 57 kg 162cm

output: Congrats, you are healthy. Your BMI is 22

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question