AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Contents · Computing

The branching algorithm: “if” and the condition

Lessons 25–27 · 3 lessons · F.M. Zakirova, M.R. Zakirova. Informatics and Information Technology Grade 2. Novda Edutainment, 2024
26

Flowchart of a branching algorithm

Textbook: pp. 69–71
GoalRead the flowchart of a branching algorithm: the condition in a diamond and the “yes” / “no” branches.
New words
diamond · rombyes · hano · yo‘qbranch · tarmoq
Explanation

In a flowchart a condition is written in a diamond. The diamond holds a question that can be answered only “yes” or “no”. Two arrows leave the diamond: one for “yes”, one for “no”. Only one branch is carried out at a time: you cannot go both right and left. A condition block is a diamond, a command block is a rectangle.

★Remember
The question in a diamond is answered only “yes” or “no”. Two arrows leave it, but only one is followed.
StartIs the lightgreen?yesnoCross the roadWaitEnd

Answer the question: Yes or No

🔀 Where will I use this?
In real life

Is the window open? If yes, we close it. If no, we do nothing.

Try it today

Think of one question and say the “yes” and “no” ways.

Worked examples
StartIs it raining?yesnoput on bootsput on shoesgo outsideEnd
(Start) → ‹Is it raining?› → yes: [put on boots]; no: [put on shoes] → [go outside] → (End).
Two arrows leave a diamond, but only one leaves a rectangle.
Class activity

“Floor flowchart”: draw a diamond on the floor with two paths (“yes” and “no”). A child answers the question and walks along the right path: “Is it raining today?”

Practice
1
It is not raining. By the flowchart above, which footwear is worn?
2
How many arrows leave a diamond?
3
Can we do both branches at the same time?
Story of the Week · The Khwarizmi WayAfter the holidayClose the week: all of this week’s subjects in one storyRead →