0% found this document useful (0 votes)
4 views17 pages

Lesson-1.-UNDERSTANDING-CONDITIONAL-CONTROL-STRUCTURE

The document provides an overview of conditional control structures in programming using Python, emphasizing the importance of analyzing problems and creating algorithms. It includes examples of pseudocode and flowcharts for programs like PIN validation and score evaluation. Additionally, it presents activities for setting conditions and drawing flowcharts for various programming scenarios.

Uploaded by

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

Lesson-1.-UNDERSTANDING-CONDITIONAL-CONTROL-STRUCTURE

The document provides an overview of conditional control structures in programming using Python, emphasizing the importance of analyzing problems and creating algorithms. It includes examples of pseudocode and flowcharts for programs like PIN validation and score evaluation. Additionally, it presents activities for setting conditions and drawing flowcharts for various programming scenarios.

Uploaded by

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

ICT 10

Lesson
1
Understanding
Conditional Control
Structure
UNIT 3: Performing Conditional
Programming Using Python
Conditional Control Structure
 is used in programs to perform
statement based on the conditions.

True
Condition Statements

False
Statement
 Are provided after the condition.
Decision Box
 Has the condition answered by true
or false.
Flowlines
 Direct the flow from top to bottom
and from left to right in a flowchart.
 Analyzing the problem is the
first step when given a problem.
 It involves identifying the
objective, the requirement for
the program to work and the user
inputs.
Algorithm
 Is a procedure created to instruct
the computer what steps to perform to
achieve the operation objectives.
 We first analyze the problem by
identifying the objective the requirement
and the user inputs.
Example:
PIN (Personal Identification
Number)
 is an alphanumeric password
used to authenticate a user’s
access in a system.
Objective: To display a message once the
entered
PIN is correct. The program should
have a
stored PIN. The PIN is “123” and
stored in
Pseudocode:
1. Assign the PIN to a variable.
2. Display the instruction to the user to
enter his or
3. her PIN.the entered PIN.
Accept
4. Evaluate if the entered PIN is the same as
the
5. stored PIN.a message when the PIN is
Display
correct.
Here is a flowchart to display a message once entered
PIN is correct: Start

Code = “123”

Output
“Please enter
the PIN:”

Enter PIN

Output “The
If PIN = PIN is
code?
correct.”

End
Example:
Score Remark

Objective: To display “You passed the quiz!”


after
evaluating if the score is passing. The
passing score that is stored in the
program
is 7.5. This is needed for the program
to
evaluate the score entered. We will
store 7.5
Pseudocode:
1. Assign the passing score to a variable.
2. Display the instruction to the user to
enter his or
3. her score.
Accept the entered score.
4. Evaluate if the entered score is greater
than or
5. equal to the
Display passing
“You score.
passed the quiz!” if the
score
passed.
Flowchart
Start

Passing Score =
7.5

Output “Please
enter your
score:”

Enter score

If score >=
Yes Output “You
passing passed the
score? quiz!”
No

End
Activity 1: Set the Conditions
Analyze the programs carefully. Write the condition of each program
in the corresponding column.
Program Condition
1. Color Guessing Game
Create a program that asks the user to guess the color.
2. Odd Number Identifier
Create a program that identifies if the entered number is
an odd number. Use the mod operator.
3. Divisibility Program
Create a program that identifies if the entered number is
divisible by 7. Use the mod operator.
Activity 1: Set the Conditions
Analyze the programs carefully. Write the condition of each program
in the corresponding column.
Program Condition
1. Color Guessing Game Guess = color?
Create a program that asks the user to guess the color.
2. Odd Number Identifier n%2 = 0
Create a program that identifies if the entered number is
an odd number. Use the mod operator.
3. Divisibility Program Is n mod 7 = 0?
Create a program that identifies if the entered number is
divisible by 7. Use the mod operator.
Activity 2: Draw the Flowchart
Create a flowchart and draw the symbol.
1. Color guessing game
Flowchart Start

Number = 7

“Guess the
number”

Guess input

False
Guess =
number ?
True
“Incorrect”
“Correct”

Game over

You might also like