0% found this document useful (0 votes)
187 views10 pages

COMP1. L4. Selection Control Structure

The document discusses flowchart control structures, specifically selection control structures that are used to test a condition and provide a choice between two alternatives. It provides examples of flowcharts that accept input data, check conditions, and output different processes or values based on those conditions. Exercises are also included to have the reader create flowcharts to solve different conditional logic problems.

Uploaded by

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

COMP1. L4. Selection Control Structure

The document discusses flowchart control structures, specifically selection control structures that are used to test a condition and provide a choice between two alternatives. It provides examples of flowcharts that accept input data, check conditions, and output different processes or values based on those conditions. Exercises are also included to have the reader create flowcharts to solve different conditional logic problems.

Uploaded by

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

lesson 4

FLOWCHART CONTROL STRUCTURE

SELECTION
CONTROL
STRUCTURE
BEGIN
SELECTION
CONTROL INPUT
DATA
STRUCTURE
CHECK
⚫ Used to test a DATA
condition and
provides for a choice PROCESS PROCESS
of one between two DATA DATA

alternatives
OUTPUT OUTPUT
DATA DATA

END
SELECTION CONTROL STRUCTURE
e.g.
1. Make a flowchart that will accept as input
a speed of an automobile. Display “over
speeding” if the speed is more than 60
kph. Else, display “normal speed”.
1. START

Speed = 0

Speed

Speed > N
60

Y
“Over speeding” “Normal
speed”

END
e.g.
2. Given the numbers X, Y and Z; prepare a
flowchart to determine and print the
following:
a. If X is greater than Y, then print Z.
b. If X is greater than Z, then print the
difference between Y and Z.
c. If X is equal to 100, then print the
sum of the numbers.
2. START

X = 0, Y = 0, Z = 0
SUM = 0, DIFF = 0

X Y Z

Y
X>Y Z
N
Y
X>Z DIFF = Y - Z DIFF
N
Y
X = 100 SUM = X + Y + Z SUM
A N
A
END
EXERCISES

1. A college student who is registered for


15 units or more is considered a full –
time student. The tuition fee for a full
time student is P2,000.00. A part – time
student is charged P150.00 per unit for
tuition. Given the number of units a
student is registering, prepare a
flowchart that will calculate and print his
tuition fee on the basis of the given
criterion.
2. Input a number. Prepare a flowchart that
would print the number and the message
“Within Range” if it is between 20 and 30,
inclusive. Otherwise, the message is
“Out of Range”.
3. An instructor uses the following scheme
to award letter grades on an
examination:
90 – 100 A
80 – 89 B
70 – 79 C
60 – 69 D
0 – 59 E

Given the numeric grade, what is its


equivalent letter grade?

You might also like