0% found this document useful (0 votes)
40 views5 pages

Sa4 1

The document contains 3 programming problems involving flowcharts and pseudocode. The first asks to create a flowchart calculating arithmetic operations. The second asks to create an algorithm and flowchart to calculate BMI based on weight and height. The third asks to create a flowchart to classify a group of people by age into infants, children, teenagers, and adults.

Uploaded by

Julliana Viloria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views5 pages

Sa4 1

The document contains 3 programming problems involving flowcharts and pseudocode. The first asks to create a flowchart calculating arithmetic operations. The second asks to create an algorithm and flowchart to calculate BMI based on weight and height. The third asks to create a flowchart to classify a group of people by age into infants, children, teenagers, and adults.

Uploaded by

Julliana Viloria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

NAME: Julliana T.

Viloria CES 1102L


BSCE – 1 DATE:

1. (35%) Draw a flowchart which will calculate the result based on the following operations:
Addition, Subtraction, Multiplication, Division and Modulo. The program shall calculate each row
of given numbers using loops.

Pseudo-code:
Start
Input N1 and N2
Output N1 + N2
Output N1 - N2
Output N1 * N2
Output N1/N2
Output N1%N2
If b=0, OUTPUT “Undefined”
End

FLOWCHART:
Start

Input N1 and N2

Output N1 + N2

Output N1 - N2

Output N1 * N2

Output N1 / N2

Output N1 % N2

End
NAME: Julliana T. Viloria CES 1102L
BSCE – 1 DATE:

2. (30%) Write an algorithm and draw a flowchart which will allow the user to enter values for
weight in pounds (lbs) and height in centimeters (cm). The program then output the body mass
index (BMI) in kg/m2 and classification of the BMI (see table below). Note: 1 lbs = 0.453592 kg
Pseudo-code:
Start
Enter “A person weight”; W(kg)
Enter “A person height”; H(m)
Divide W by H^2, where the results is the “BMI”
Let BMI<18.5
If yes, print “Underweight”
If no, don’t print “Underweight”
Let BMI>18.5 but BMI<22.9
If yes, print “normal range”
If no, don’t print “normal range”
Let BMI>25 but BMI<29.9
If yes, print “obese I”
If no, don’t print “obese I”
Let BMI>30
If yes, print “obese II”
If no, don’t print “obese II”
End
NAME: Julliana T. Viloria CES 1102L
BSCE – 1 DATE:

Flowchart:

Start

Enter “A person weight”; W(kg)

Enter “A person height”; H(m)

Divide W by H^2, where the


results is the “BMI”

If yes, print “Underweight” If no, don’t print “Underweight”


Let BMI<18.5

If yes, print “normal range” Let BMI>18.5


If no, don’t print “normal range”
but BMI<22.9

If yes, print “obese I” Let BMI>25


If no, don’t print “obese I”
but BMI<29.9

If yes, print “obese II” Let BMI>30 If no, don’t print “obese II”

End
NAME: Julliana T. Viloria CES 1102L
BSCE – 1 DATE:

3. (35%) Create a flowchart that shall determine the number of infants (0-2), children (3-12),
teenagers (13-17), adults (18 & above) in a group of people. The user shall input the number of
people to classify. Use loops in entering the age of the people. After all the ages are entered,
display the number of persons classified as infant, children, teenagers and adults.

Pseudo-code:

START
INPUT age of a person (AP)
INITIALIZE Count (C), C=0
While C<15
GET number of infants (I), when AP>0 but AP<2
GET number of children’s (CH), when AP>3 but AP<12
GET number of teenagers (T), when AP>13 but AP<17
GET number of adults (A), when AP>18
DISPLAY number of infants (I)
DISPLAY number of children’s (CH)
DISPLAY number of teenagers (T)
DISPLAY number of adults (A)
OUTPUT
END

Start
FLOWCHART:

INPUT age of a person (AP)

INITIALIZE Count (C), C=0

GET number of infants (I), when While C<15


GET number of children’s (CH),
AP>0 but AP<2
when AP>3 but AP<12

GET number of teenagers (T),


GET number of adults (A), when
when AP>13 but AP<17
AP>18

DISPLAY number of infants (I)

DISPLAY number of children’s


(CH)

DISPLAY number of teenagers


(T)

DISPLAY number of adults (A)


NAME: Julliana T. Viloria CES 1102L
BSCE – 1 DATE:

End

You might also like