Algo

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

NAME: JELLAMAE U.

ENGUIG YR/SECTION: BSIT 2-1

Activity 2: Create an Algorithm on the Scenario


First, the user will input the height in meters and weight in kilograms. After inputting, the
inputted data will be processed – the weight will be divided by height in meters squared
to get the BMI. The calculated BMI will be going into a decision. If the calculated BMI fall
to <18.5, it will be categorized as “underweight”; if <24.9, it is “normal weight”; if <30, it
is “overweight”; and if the user got the higher result than usual, it will be categorized as
“obesity”.

Step 1: Start
Step 2: Declare variable h, w, and BMI
Step 3: Define the values of h and w
w
Step 4: BMI ←
h∗h
Step 5: If BMI < 18.5 then print “underweight”
Else
If BMI < 24.9 then print “normal weight”
Else
If BMI < 30 then print “overweight”
Else
Print “obesity”
Step 6: Stop

You might also like