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
27

Review. Test 4

Textbook: pp. 72–73
GoalReview Chapter 4: flowchart shapes, linear and branching algorithms.
New words
review · takrorlashlinear · chiziqlicondition block · shart blokito check · tekshirmoq
Explanation

Let us recall: an oval is start and end, a rectangle is an action, a diamond is a condition, an arrow is order. If actions are one after another it is a linear algorithm (no diamond). If it depends on a condition it is a branching algorithm (there is a diamond). To check an algorithm we try it out with an example.

ShapeJob
ovalstart and end
rectangleone action
diamondcondition (yes / no)
arroworder of actions
Brushing teeth: step after step1 / 6

Which group does it belong to?

🏆 Where will I use this?
In real life

The shapes in this chapter help to show a plan clearly.

Try it today

Draw one shape from the chapter in the air.

Worked examples
Startnumbernumber > 5yesnowrite “big”write “small”End
Algorithm: if the number is greater than 5, write “big”, otherwise write “small”. For 8: “big”; for 3: “small”; for 5: also “small”.
“Brushing teeth” is a linear algorithm, “What to wear?” is a branching algorithm.
Class activity

“Which algorithm?”: the teacher names an algorithm (washing hands, crossing the road, making tea, dressing for the weather). Children show “linear” (arms in a straight line) or “branching” (arms in a “Y” shape).

Practice
1
Algorithm: if the number is greater than 5 — “big”, otherwise — “small”. What is the answer for 5?
2
Crossing the road at a traffic light is which kind of algorithm: linear or branching?
3
Inside which shape is a condition written?
Story of the Week · The Khwarizmi WayAfter the holidayClose the week: all of this week’s subjects in one storyRead →