Read the complete lesson, check the fully solved exercises, then test yourself with the MCQs quiz. Teachers get a complete guide with this unit.
Sindh Textbook Board50 MCQs5 Practice Sets
Computer Education — Class 7 · Unit 3 · Printed pages 78–104
Source: The Textbook of Computer Education for Class VII, Sindh Textbook Board, Jamshoro.
About this source
Textbook text is reproduced for free educational study. All solutions, explanations, practice questions, diagrams and teacher's guides are original work by 100MCQs. 100MCQs is an independent site and is not affiliated with or endorsed by the Sindh Textbook Board. Read our Disclaimer.
📖 Lesson — Algorithmic Thinking and Problem Solving
Below is the complete lesson of Unit 3 from the textbook (printed pages 78–104), in the book's own order. Read it fully — important words are bold. Inside the parts you will find word boxes: 📚 Book Vocabulary (the book's own words, marked ⭐) and 🌱 Extra Help Words. Where the book prints something that needs a correction or a caution, a note keeps the book's words and explains openly.
📖 Lesson — Algorithmic Thinking and Problem Solving
Below is the complete lesson of Unit 3 from the textbook (printed pages 78–104), in the book's own order. Read it fully — important words are bold. After every part you will find two word boxes: 📚 Book Vocabulary (the book's own words, marked ⭐) and 🌱 Extra Help Words. Where the book prints something that is wrong, a note keeps the book's words and gives the correction openly.
Part 1 — Computational Thinking (printed pp 78–79)
Introduction to the Unit. This chapter introduces algorithmic thinking to solve complex problems. In this chapter, we will learn how to think like a computer scientist by applying computational thinking to solve problems in a smart and organized way. This chapter also covers how to design algorithms and flowcharts for solving different problems using algorithmic notations.
Student Learning Outcomes (printed p 78). After the completion of this unit students will be able to:
Solve complex problems by applying computational thinking.
Understand different steps of computational thinking to solve a complex problem.
Define algorithms and provide simple real-life examples of algorithms.
Design algorithms for complex problems.
Draw flowcharts for representing algorithms.
Understand control structures including conditions and loops.
Apply conditions and loops for designing algorithms.
Infer clear instructions to produce correct results.
Analyze different ways to solve the same problem.
Understand and validate the algorithms to solve the problem.
3.1 Computational Thinking. Computational thinking helps to solve big problems step by step. It works like a computer. Its key steps:
Break it down – Split big problems into small parts.
Ignore extras – Remove things that don't matter.
Plan clearly – Make a smart step-by-step solution.
A simple problem is one that can be solved in two to three easy steps. Example: Tying shoelaces or solving 5 + 3.
A complex problem needs more steps, planning, and decisions. Example: Organizing a school event.
Computational thinking is comprised of four important skills, shown in the book's Figure 3.1:
Skill
What it means
Decomposition
Breaking down a problem into smaller parts which are easier to solve.
Abstraction
Identifying only the important details of a problem and ignoring the rest.
Logical Thinking
Solving a given problem step-by-step in a clear and organized way — making a clear plan.
Decision Making
Selecting the best solution among different options.
📚 Book Vocabulary — Words in this part
computational thinking — Thinking like a computer scientist: solving a problem in a smart, organised, step-by-step way. ⭐Book word
simple problem — A problem that can be solved in two to three easy steps, e.g. tying shoelaces or solving 5 + 3. ⭐Book word
complex problem — A problem that needs more steps, planning and decisions, e.g. organising a school event. ⭐Book word
🌱 Extra Help Words — Words in this part
sequence — Things following one after another in a fixed order.
Part 2 — Applying Computational Thinking: the Clean and Green Pakistan Day (printed p 80)
3.1.1 Applying Computation Thinking to Solve Complex Problems. Consider a problem to organize an event "Clean and Green Pakistan Day". Students will clean classrooms. They will plant trees. They will spread awareness to keep Pakistan clean. This is a complex problem. It needs computational thinking to solve it. Break it into small steps.
Steps of Computational Thinking:
Understand the Problem – What needs to happen? Who joins? When and where?
Break It Down – Split into parts: Planning, cleaning, planting, awareness.
Find Patterns – Reuse ideas, like group teams for all tasks.
Ignore Extras – Skip things not needed, like fancy decorations.
Make a Plan – Step-by-step: Invite people, get tools, do the event, check results.
1. Decomposition. Breaking a big or complex problem into smaller manageable tasks. For example, organizing an event "Clean Pakistan Day". The smaller manageable tasks may include: prepare a task list; register volunteers for each task; prepare a list of equipment for each task; choose team leads; set day and time of each event.
Example Plan: Step 1: List supplies (brooms, seeds, posters). Step 2: Assign jobs (Group A cleans, Group B plants). Step 3: Practice speeches for awareness. Step 4: Hold the event and clean up.
📚 Book Vocabulary — Words in this part
decomposition — Breaking down a problem into smaller parts which are easier to solve. ⭐Book word
Part 3 — Abstraction and Logical Thinking (printed p 81)
2. Abstraction means: ignore things that do not help; focus on only important details.
Important (Keep)
Irrelevant (Ignore)
Number of volunteers
Color of their shirts
Number of trees to plant
Brand of planting tools
Cleaning areas (classrooms)
Shape of the dustbins
Date and time
Weather next week
Items for safety (gloves and masks)
Brand of masks
Getting permission from school
—
Abstraction helps to 1) save time, 2) keep plan simple, and 3) helps to finish task quickly.
3. Logical Thinking. Make a clear and simple plan. Event Plan — Clean and Green Pakistan Day:
Get permission — Ask the principal to approve the event.
Make volunteer groups — Cleaning Group (clean classrooms), Planting Group (plant trees), Awareness Group (make and paste posters).
Example: Step 1: Principal says YES. Step 2: 10 students in Cleaning Group. Step 3: Buy 20 trees. Step 4: Event on Friday at 8 AM.
📚 Book Vocabulary — Words in this part
abstraction — Ignoring irrelevant information and focusing on only the important details of a problem. ⭐Book word
logical thinking — Making a clear and organised plan of what to do, and in what order. ⭐Book word
Part 4 — Decision Making (printed p 82)
4. Decision Making. Good choices help the event succeed — even with problems/challenges.
Challenge Faced
Smart Decision
Low budget
Choose cheap plants (like local seeds)
Few volunteers
Join two groups into one
Rain coming
Move event inside or pick a new date
Example: Rain forecast? Hold poster-making in the hall. Only 5 helpers? One team cleans and plants. Note: Think fast, act smart — every problem has a fix.
📚 Book Vocabulary — Words in this part
decision making — The process of making smart and good decisions in the presence of challenging situations. ⭐Book word
Part 5 — What is an Algorithm? (printed pp 82–83)
3.2 Algorithm. An algorithm is a step-by-step plan to solve a problem. It is a well-defined and finite sequence of instructions to solve a problem or perform a specific task. Everyday Life Examples: following a cake recipe; solving a math problem step by step.
Problem: A customer buys a Mouse at Rs. 500, Keyboard at Rs. 1200 and Watch at Rs. 800. Find the total amount to pay.
ALGORITHM (STEP-BY-STEP)
Start
Write price of mouse = 500
Write price of keyboard = 1200
Write price of watch = 800
Add all prices: 500 + 1200 + 800
Total = 2500
Stop
Total Amount: Customer pays Rs 2500. (Trace it: 500 + 1200 = 1700, and 1700 + 800 = 2500. Remember this total — the validation example on printed page 98 uses these same prices.)
The same algorithm can be written with variables. Algorithm: To calculate total price paid by a customer on buying three products. Step-1: Input price of mouse, 'P1'. Step-2: Input price of keyboard, 'P2'. Step-3: Input price of watch, 'P3'. Step-4: Calculate total price, Price = P1 + P2 + P3. Step-5: Print Total Price. Step-6: End.
Let's say: Price of mouse = Rs. 100; Price of keyboard = Rs. 250; Price of watch = Rs. 200. Total Price = 100 + 250 + 200 = Rs. 550. Thus customer pays Rs. 550 as total price.
📚 Book Vocabulary — Words in this part
algorithm — A well-defined and finite sequence of instructions to solve a problem or perform a specific task. ⭐Book word
🌱 Extra Help Words — Words in this part
instruction — A single order that tells a computer or robot exactly one thing to do.
input — The data given to an algorithm for it to work on, e.g. the marks of a subject.
Part 6 — Flowcharts and Their Symbols (printed p 83)
3.3 Flow Charts. A flowchart is a graphical representation of an algorithm. Table 3.1 shows commonly used symbols for drawing flowcharts along with their description:
Shape
Name
Purpose
Example
Oval
Terminator
Shows Start or End of a flowchart
Start, End
Parallelogram
Input / Output
Used for taking input or showing output
Input number, Display result
Rectangle
Process / Action
Represents a process or step to perform
Add 2 numbers, Calculate area
Diamond
Decision
Represents a decision or condition
Is number > 0?, Is it raining?
Arrow
Flowline / Arrow
Shows direction of flow
Connects symbols to show sequence
📚 Book Vocabulary — Words in this part
flowchart — A graphical (diagram) representation of an algorithm. ⭐Book word
oval (terminator) — The flowchart symbol that shows the Start or End of a flowchart. ⭐Book word
parallelogram (input/output) — The flowchart symbol used for taking input or showing output. ⭐Book word
rectangle (process) — The flowchart symbol that represents a process or a step to perform. ⭐Book word
diamond (decision) — The flowchart symbol that represents a decision or condition. ⭐Book word
flowline — The arrow symbol that connects flowchart symbols to show the flow (sequence) of the algorithm. ⭐Book word
🌱 Extra Help Words — Words in this part
output — The result an algorithm produces and shows, e.g. "You are Pass".
Part 7 — Control Structures and the IF Statement (printed p 84)
3.4 Control Structures for Writing Algorithms. Control structures are building blocks of algorithms. There are two main types of control structures: Conditions and Loops/Iteration. This section will explore how these control structures can be applied to solve complex problems.
3.4.1 Conditions. Sometimes, a user wants to choose different actions based on different situations. Conditions allow algorithms to make choices. For example: If it rains today, then I will take umbrella. If it is holiday, I will not go to school. Otherwise, I will go to school. If the password is correct, allow login.
i) If Statement. This statement gives only one choice. If the condition is true then it will take some action, otherwise it will skip the action. For example, if today is a holiday I will not go to school.
ALGORITHM: TO CHECK IF YOU ARE PASS IN A SUBJECT
Start
Input marks of a subject, Marks
If Marks >= 50, then:
Print "You are Pass"
End
The flowchart in words: Start → Print "Input Marks of a Subject", Marks → If Marks >= 50? — Yes → Print "You are Pass" → Stop; — No → go straight to Stop. In this algorithm, if the given condition Marks >= 50 becomes true, only then will it take an action, to display "You are Pass". Otherwise, no action is performed when the condition is false.
📚 Book Vocabulary — Words in this part
control structure — A building block of an algorithm that controls the order of steps; the two main types are conditions and loops. ⭐Book word
condition — A check that lets an algorithm make a choice, e.g. "If Marks >= 50". ⭐Book word
if statement — A conditional statement that takes an action only if its condition is true; otherwise it does nothing. ⭐Book word
🌱 Extra Help Words — Words in this part
branch — A path an algorithm can take when a condition sends the flow one way or another.
Part 8 — The If-Else Statement (printed p 85)
ii) If-Else Statement. This statement gives two choices: if the given condition is true it takes an action, but when the condition is false it takes an alternative action. For example: if you obtain 50 marks then you are pass, otherwise you are fail.
ALGORITHM: TO CHECK IF YOU ARE PASS OR FAIL IN A SUBJECT
Start
Input marks of the subject, Marks
If Marks >= 50, then:
Print "You are Pass"
Else:
Print "You are Fail".
End
The flowchart in words: Start → Print "Input Marks of a Subject", Marks → If Marks >= 50? — Yes → Print "You are Pass" → Stop; — No → Print "You are Fail" → Stop. When the given condition Marks >= 50 is true, it takes an action (Print Pass). When the condition is false it takes another action (Print Fail).
📚 Book Vocabulary — Words in this part
if-else statement — A conditional statement that takes one action if the condition is true and another action if it is false. ⭐Book word
Part 9 — The If-ElseIf-Else Statement (printed p 86)
iii) If-ElseIf-Else Statement. The If-ElseIf-Else statement allows us to check multiple conditions. The computer will check all conditions in a given order, and it only runs the one that is true. For example: If your marks are above 80, you get Grade A. Else If marks are above 60, you get Grade B. Else If marks are above 50, you get Grade C. Else, you are Fail.
ALGORITHM: TO CHECK WHICH GRADE IS OBTAINED
Start
Input marks of a subject, Marks
If Marks > 80, then:
Print "Grade-A"
Else If Marks > 60, then:
Print "Grade-B".
Else If Marks > 50, then:
Print "Grade-C".
Else
Print "You are Fail".
The flowchart in words: Start → Input Marks → If Marks > 80? — Yes → Print "Grade A" → Stop; — No → If Marks > 60? — Yes → Print "Grade B" → Stop; — No → If Marks > 50? — Yes → Print "Grade C" → Stop; — No → Print "You are Fail" → Stop.
Trace it: Marks = 65 → not above 80 → above 60 ✓ → Grade B. Marks = 50 → not above 80, 60 or 50 (the book says "above", not "equal to") → You are Fail. Notice the difference from the pass/fail algorithm, where Marks >= 50 means exactly 50 is a Pass.
📚 Book Vocabulary — Words in this part
if-elseif-else statement — A conditional statement that checks multiple conditions in order and runs only the first one that is true. ⭐Book word
Part 10 — Finite Loops (printed pp 87–88)
3.4.2 Loops/Iteration. Imagine giving instructions to a robot to perform the same action over and over again. For example, 'clap your hands', 'clap your hands', 'clap your hands'…". This repetition is called a loop.
i) Finite Loops. A finite loop is a set of instructions that repeats for a fixed number of times, and then it stops. It always has a clear end point. For example: taking input of five numbers from user; clapping 10 times; doing fifteen push-ups, etc. A finite loop is used in two situations: 1) Knowing exactly how many times to repeat. For example: we do homework 3 times. 2) Not knowing exactly how many times to repeat but the task is repeated until some goal is achieved. For example: we brush our teeth until they get clean.
ALGORITHM-1: DISPLAY EVEN NUMBERS FROM 2 TO 10
Start
Repeat step 3 and 4 for Counter = 2 to 10
Print Counter
Increase Counter by 2
End
The flowchart in words (printed p 88): Start → Set Counter = 2 → Is Counter <= 10? — Yes → Print Counter → Set Counter = Counter + 2 → back to the question; — No → Stop.
Trace it: Counter = 2 → print 2 → Counter = 4 → print 4 → 6 → print 6 → 8 → print 8 → 10 → print 10 → Counter = 12 → 12 <= 10 is false → Stop. Output: 2, 4, 6, 8, 10. It is known that the loop will repeat for a fixed number of times.
📚 Book Vocabulary — Words in this part
loop (iteration) — A control structure that repeats a set of instructions. ⭐Book word
finite loop — A set of instructions that repeats a certain number of times, or until its goal is achieved, and then stops. ⭐Book word
counter — A value used to keep count of how many times a loop has repeated, e.g. Counter in the even-number flowchart. ⭐Book word
🌱 Extra Help Words — Words in this part
value — A single piece of data, such as a number or a piece of text.
Part 11 — Finite Loop Example: Printing a Sentence Three Times (printed p 89)
ALGORITHM-2: TO DISPLAY A SENTENCE THREE TIMES ON SCREEN
Start
Set Counter = 1
Repeat steps 4 to 6
Display "Long Live Pakistan"
Increase Counter by 1
Until Counter > 3
End
The flowchart in words: Start → Set Counter = 1 → Print "Long Live Pakistan" → Set Counter = Counter + 1 → Is Counter <= 3? — Yes → back to Print; — No → Stop.
Trace it: This algorithm will repeat exactly three times and each time it will print "Long Live Pakistan". When Counter becomes greater than 3, the loop stops. (Counter is 1, 2, 3 for the three prints; after the third print Counter becomes 4, and 4 <= 3 is false.)
🌱 Extra Help Words — Words in this part
variable — A named store for a value that can change while an algorithm runs, e.g. Counter or Marks.
Part 12 — Infinite Loops (printed pp 90–91)
ii) Infinite Loops. Infinite loops are tasks which keep on repeating over and over and never stop. For example: heart beating; monitoring by a security camera, etc. An infinite loop describes a series of instructions that repeats forever or until someone stops them.
ALGORITHM-1: KEEP BLINKING AN LED LIGHT
Start
Repeat steps 3 to 6 Forever:
Turn LED ON.
Wait 1 second.
Turn LED OFF.
Wait 1 second.
The flowchart in words: Start → Turn LED ON → Wait for 1 second → Turn LED OFF → Wait for 1 second → (line labelled "Repeat") back to Turn LED ON. In this algorithm, the steps inside the loop (steps 3 to 6) will keep repeating forever unless manually stopped (e.g., turning off the device).
ALGORITHM-2: TO CHECK TEMPERATURE
Start
Repeat Steps 3 to 5
Input temperature through sensor
Print temperature
Wait 5 seconds
End Repeat
End
The flowchart in words (printed p 91): Start → Is condition true? — Yes → Read temperature sensor value → Print temperature → Wait for 5 second → back to the question; — No → Stop. This algorithm will keep on taking input of temperature forever (while its condition stays true).
Print note (printed p 91): the book's printed step algorithm (Algorithm-2) contains no condition or stop test at all — it repeats Steps 3 to 5, and the book's own callout beside it says it “will keep on taking input of temperature forever”. The “Is condition true?” test and the Stop appear only in the printed flowchart; the flowchart's version is the one taught above.
📚 Book Vocabulary — Words in this part
infinite loop — A series of instructions that repeats forever, or until someone stops it. ⭐Book word
Part 13 — Using Loops and Conditions: the Robot That Waters Plants (printed pp 91–92)
3.5 Using Loops and Conditions for Designing Algorithms. By understanding, breaking down, and planning, you can solve any complex problem with a clear algorithm. Examples of Complex Problems: 1. Finding the shortest path to school during traffic. 2. Planning a study schedule for exams. 3. Sorting 100 books in the library by name. 4. Programming a robot to water plants.
Robot Watering Algorithm (Example). Problem: Plants are in a straight line. Each has a moisture sensor. The robot must water only dry plants and skip wet ones.
ALGORITHM (STEP-BY-STEP)
Start at the first plant
Check moisture sensor
If low → Pour water
If normal → Skip
Move to the next plant
Repeat until the last plant
Stop
Example Run/Execution:
Plant
Moisture
Action
1
Low
Water
2
Normal
Skip
3
Low
Water
4
Normal
Skip
The book also writes this algorithm with a while loop and a counter. Algorithm: A robot waters a plant if moisture level is low, otherwise move to the next plant. Step 1: Start. Step 2: Set PlantCounter = 1. Step 3: Set TotalPlants = N. Step 4: while (PlantCounter <= TotalPlants) Do — (a) Read Moisture level of current plant; (b) If moisture level is low, then water Plant; (c) Set PlantCounter = PlantCounter + 1. Step 5: End While. Step 6: End.
Trace the while algorithm with the run table above (N = 4): PlantCounter = 1 → plant 1 is Low → water → counter 2 → plant 2 is Normal → no water → counter 3 → plant 3 is Low → water → counter 4 → plant 4 is Normal → counter 5 → 5 <= 4 is false → End. Every plant is checked exactly once. Remember this correct behaviour — it is the standard the flowchart on the next printed page must match. This problem is complex because it involves making a smart decision based on moisture level, and it shows involvement of input from the environment (moisture level from sensor).
📚 Book Vocabulary — Words in this part
moisture sensor — A sensor that measures how wet or dry something is; in the example it tells the robot whether a plant needs water. ⭐Book word
🌱 Extra Help Words — Words in this part
notation — A standard way of writing something, e.g. the symbols and short forms used in algorithms and flowcharts.
Part 14 — The Robot Flowchart, Checked Carefully (printed p 93)
The book prints a flowchart for the robot algorithm on page 93. As printed, it reads: Start → Set PlantCounter = 1 → Set TotalPlants = N → Is PlantCounter > TotalPlants? — the No exit runs to Stop, and the Yes exit runs down to Read Moisture Level of current plant → Is Moisture Level Low? — Yes → Water Plant → Set PlantCounter = PlantCounter + 1 → back to the first question; — No → straight back to the first question.
Textbook correction (printed p 93): We traced this flowchart by hand, and as printed it does not work. It has two mistakes. Mistake 1 — the Yes/No exits of the first decision are swapped. At the start PlantCounter = 1, which is NOT greater than TotalPlants, so the printed chart takes the "No" exit — straight to Stop. The robot stops before checking even one plant. (And if the answer were ever Yes, it would try to read a plant that does not exist.) Mistake 2 — the skip path forgets to count. When a plant is skipped (moisture not low), the printed flow returns to the first question without adding 1 to PlantCounter, so the robot would re-check the same wet plant forever and never reach the later plants. The step-by-step algorithm on printed page 92 is correct — only this flowchart drawing is wrong. The corrected flowchart is given below.
The corrected flowchart (drawn by 100MCQs from the book's own correct algorithm on page 92): the first decision sends the robot to Stop only when PlantCounter has passed the last plant, and PlantCounter increases by 1 after every plant — watered or skipped.
Text alternative for the corrected flowchart: Start → Set PlantCounter = 1 → Set TotalPlants = N → Is PlantCounter > TotalPlants? — Yes → Stop. — No → Read Moisture Level of current plant → Is Moisture Level Low? — Yes → Water Plant → Set PlantCounter = PlantCounter + 1 → back to the first question. — No → Set PlantCounter = PlantCounter + 1 → back to the first question.
Part 15 — Inferring Clear Instructions (printed pp 93–94)
3.6 Inferring Clear Instructions. An algorithm must have clear steps. A computer follows them exactly. If steps are confusing, the result will be wrong. Imagine: Wali tells a robot to build a LEGO car. If his instructions are not clear, the robot may build a boat or plane instead.
Rules for Clear Algorithm Instructions: Use simple words — say "pick red brick" not "select crimson piece". Give one step at a time — don't mix actions. Be exact — say "place 2 wheels on left side" not "add some wheels". List steps in order — Step 1, Step 2, Step 3… Check the result — make sure the car moves and has 4 wheels.
Example: Build a LEGO Car (Clear Steps). 1. Take a yellow base plate (4×8). 2. Attach 2 black wheels to the back. 3. Attach 2 black wheels to the front. 4. Place a red seat in the middle. 5. Add a blue steering wheel. 6. Done — Wali has a car.
Rule-1: Be Specific and Do Not Guess. Computers don't think like humans. They follow only what a person tells. They cannot guess. Bad Instruction (Unclear) Example: "Make a red car." Problem with Bad Instruction: 1. Which part is red? 2. How much red? 3. Robot might make only wheels red or everything green! Good Instruction (Clear) Example: 1. Take four 2×4 red LEGO bricks. 2. Attach one red 2×4 brick on top of each black 2×2 wheel base. Result: Robot builds the correct red car body every time.
Rule-2: Break Down the Instructions into Smaller Steps. Always try to break big tasks into smaller easy-to-follow tasks. For example, if a robot has to build a LEGO car, then only the instruction "build car" is considered as too big. Instead: Step-1: Take one 5×10 gray colored base plate. Step-2: Take four black 3×3 wheel bases. Step-3: Attach one black 3×3 wheel base to each corner of the 5×10 gray base plate. Step-4: Take two 1×4 black axles. Step-5: Attach one axle to the front two wheel bases and one axle to the back two wheel bases. Step-6: Take four small black tires. Step-7: Attach one tire to each end of the axles.
🌱 Extra Help Words — Words in this part
step-by-step — Doing something one step at a time, in order, without skipping.
Part 16 — Rules 3, 4 and 5 for Clear Instructions (printed pp 95–96)
Rule-3: Clear Start and End Points. To write an algorithm, one should clearly specify where it starts and where it ends. (The book repeats the LEGO car steps, now numbered Step-1 "Start" to Step-9 "End".) Specifying "Start" and "End" makes it clear when an algorithm is active.
Rule-4: Specify Conditions Appropriately. While writing algorithms, one should clearly specify conditions; because sometimes, an algorithm needs to do different things depending on the situation. For example, to ask a robot to pick up a toy, one needs to clearly tell the robot what to do when a toy is not there. It should not get stuck if it cannot find a toy. Step-1: Start. Step-2: Look for a toy on floor. Step-3: If you see a toy, then: a. Move towards toy. b. Pick up toy. c. Carry toy to toy box. d. Put toy in toy box. Step-4: Else (if you do not see a toy), then: a. Look in a different spot. Step-5: If all toys are in toy box, then Stop. Step-6: Else (if there are still toys on the floor), then: a. Go back to step 1. The clear specifications of conditions help the robot to make smart decisions because it cannot make a guess.
Rule-5: Specify Loops Appropriately. Just like conditions, it is necessary to specify clearly when to repeat a task. For example, ask a robot to clean 3 tables. Simply say "keep wiping tables until there are no more dirty ones", instead of saying, "wipe table 1, wipe table 2, wipe table 3". Step-1: Start. Step-2: Go to first table. Step-3: Repeat if there are still dirty tables in row: a. Wipe down current table. b. Move to next table in row. Step-4: Goto Step-3. Step-5: End. Following these rules, a computer (robot) will be able to perform instructions perfectly and will produce correct results.
Part 17 — Activity: Clear and Unclear Instructions (printed p 96)
Activity Time. Analyze the given examples thoroughly and think why the instructions in the 3rd column of "Unclear Instructions" are not clear. (This activity is solved in the Solved Exercise tab.)
S#
Example Task
Clear Instructions
Unclear Instructions
1
Checking if a Number is Even or Odd
1. Start. 2. Input a number: N. 3. If N % 2 == 0, display "Even". 4. Else, display "Odd". 5. End.
Take a number. Decide if it's even or odd. Show result.
2
Finding Average of 3 Test Scores
1. Start. 2. Input three test scores: score1, score2, score3. 3. Calculate total: total = score1 + score2 + score3. 4. Calculate average: average = total / 3. 5. Display average. 6. End.
Get marks. Add them. Find average.
Part 18 — Different Ways to Solve the Same Problem (printed pp 96–97)
3.7 Different Ways to Solve Problem. One problem can have many solutions. Each algorithm may work differently but give the same correct answer. Problem: Check if a number is even or odd.
Algorithm 1: Using Division. 1. Take the number. 2. Divide by 2. 3. If remainder = 0 → Even. 4. Else → Odd. Example: Number = 8; 8 ÷ 2 = 4 (remainder 0) → Even.
MINOR PRINT SLIP (printed p 96): as printed, the example line reads “Number = 8 8 ÷ 2 = 4 (remainder 0) → Even” — the number 8 is printed twice. The intended working is the one shown above.
Algorithm 2: Using Last Digit. 1. Look at the last digit. 2. If it is 0, 2, 4, 6, or 8 → Even. 3. Else → Odd. Example: Number = 15; last digit = 5 → Odd.
Algorithm 3: Using Bit Check (Advanced). 1. Look at the least significant bit (LSB). 2. If LSB = 0 → Even. 3. If LSB = 1 → Odd. Example: Number = 10 (Binary: 1010); LSB = 0 → Even.
Number
Algorithm 1
Algorithm 2
Algorithm 3
Final Answer
7
7÷2 = 3 rem 1 → Odd
Last digit 7 → Odd
LSB = 1 → Odd
Odd
12
12÷2 = 6 rem 0 → Even
Last digit 2 → Even
LSB = 0 → Even
Even
All three algorithms agree on both numbers — different ways, same correct answer.
📚 Book Vocabulary — Words in this part
remainder — What is left over after division, e.g. 7 ÷ 2 gives remainder 1. ⭐Book word
Part 19 — Two Methods in Detail (printed p 97)
Remainder check method: This method divides the given number by 2 and then checks for remainder value. If the remainder value is zero it means the number is even; otherwise, the number is odd.
SOLUTION-1: CHECK EVEN OR ODD USING "REMAINDER CHECK METHOD"
Start
Input number, Num
If (Num % 2 == 0), then:
Print num is even
Else:
Print: num is odd.
End.
For example: if Num is 7, then 7÷2 is 3 with a remainder of 1. If remainder is not equal to 0, then Num (7) is odd. If Num is 8, then 8÷2 is 4 with a remainder of 0. If remainder is equal to 0, then Num (8) is even.
Look last digit method: This method is a simple way to check if a number is even or odd by only looking at its last digit. If the last digit is 0, 2, 4, 6 or 8, then the number is even. Otherwise, if the last digit is 1, 3, 5, 7, and 9, then it is an odd number.
Textbook correction (printed p 97): In the paragraph above, the book's printed sentence lists the even last digits as "0, 2, 4, 8" — the digit 6 is missing in that one sentence. The book's own Algorithm 2 (printed p 97) and Solution-2 below both include 6 ("0, 2, 4, 6, or 8"), and 6 is of course an even digit. Learn the full set: 0, 2, 4, 6, 8.
SOLUTION-2: CHECK EVEN OR ODD USING "LOOK LAST DIGIT METHOD"
Start
Input number, Num
Look at the very last digit of Num
If the last digit is 0, 2, 4, 6, or 8, then:
Print num is even
Else — if the last digit is 1, 3, 5, 7, or 9:
Print: num is odd.
End.
For example: if Num be 124, since the last digit of 124 is 4, 124 is Even. If Num be 7, since the last digit of 7 is 7, 7 is Odd.
📚 Book Vocabulary — Words in this part
least significant bit (LSB) — The last (right-most) bit of a binary number; if it is 0 the number is even, if it is 1 the number is odd. ⭐Book word
Part 20 — Understanding and Validation of Algorithms (printed p 98)
3.8 Understanding and Validation of Algorithms. Writing an algorithm is not enough. A person must understand it and check if it really works.
1. Understanding an Algorithm. It means: know what each step does; know why the step is needed; know how it helps solve the problem. If a person does not understand, then he/she may miss details and make mistakes.
2. Validating an Algorithm. It means: test if it gives correct results; try it with different inputs; see if output is right. If wrong → Fix the steps.
Key Terms in Validation:
Term
Meaning
Example
Statement / Data
Input the algorithm gets
Numbers, text, prices
Correct Data
Normal inputs it should handle
Age = 12, Name = "Ali"
Incorrect Data
Wrong or extreme inputs
Age = −5, Name = "" (empty)
Determining Output
Follow each step with input
See if total price = 2800 (as printed — see the correction note below)
Example: Test Total Price Algorithm. Algorithm: Add prices of mouse (500), keyboard (1200), watch (800).
Input Type
Test Data
Expected Output (as printed)
Result (as printed)
Correct
500, 1200, 800
2800
☑ Pass
Incorrect
−100, 1200, 800
Should show error
☑ Pass (if handles error)
Textbook correction (printed p 98): Add the test data yourself: 500 + 1200 + 800 = 2500, not 2800. The book's own total-price algorithm on printed page 82 also gives Total = 2500 for these same prices. So the printed value 2800 — used in the Key Terms table above and as the "Expected Output" in this test table — is wrong, and a correct algorithm would actually fail this test as printed — the book's test data, not the algorithm, has the mistake. When you validate an algorithm, the expected output must be calculated correctly first; here the correct expected output is 2500, and with that value the result really is a Pass. (The second row is fine: a negative price is incorrect data, and a good algorithm should show an error for it.)
📚 Book Vocabulary — Words in this part
validation — The process of checking if an algorithm really works as expected. ⭐Book word
correct data — The normal inputs an algorithm should handle, e.g. Age = 12, Name = "Ali". ⭐Book word
incorrect data — Wrong or extreme inputs used to test an algorithm, e.g. Age = −5. ⭐Book word
determining output — Following each step of an algorithm with a given input to see what output it produces. ⭐Book word
🌱 Extra Help Words — Words in this part
test data — Chosen example inputs used to check whether an algorithm works.
expected output — The correct result a test should produce if the algorithm is right.
dry run — Following an algorithm by hand with sample values to check what it does, before or instead of running it on a computer.
Part 21 — Testing with Cases, Summary and Terms to Remember (printed pp 99–100)
Example-1: Write an algorithm to check the age of a person for driving. Step-1: Start. Step-2: Input Age of person, Age. Step-3: If (Age >= 18), then: Step-4: Print: You are eligible to drive. Step-5: Else: Print: You are not eligible to drive. Step-6: End.
Now, do testing using different data values and see what output is produced by the above algorithm. To perform testing, consider following three different examples of data: Case-I: Age = 20 (it represents valid data). Case-II: Age = 17 (it represents valid data). Case-III: Age = −5 (it represents invalid data).
Trace the three cases: Age = 20 → 20 >= 18 ✓ → "You are eligible to drive". Age = 17 → 17 >= 18 ✗ → "You are not eligible to drive". Age = −5 → an age can never be negative, so this is invalid data — a well-built algorithm should reject it with an error instead of deciding about driving.
SUMMARY
Computational thinking is the foundation of writing algorithms to solve complex problems and is comprised of four important skills: Decomposition, Abstraction, Logical Thinking, and Decision Making.
Algorithm: A well-defined sequence of steps to solve a problem.
A flowchart shows visually steps required to complete a task and an order that is to be performed.
Conditions allow algorithms to make smart choices.
If conditional statement gives only one choice. If condition is true then it will take some action, otherwise it will do nothing.
If-Else statement gives two choices; if a given condition is true, it takes an action but if condition is false, it takes another action.
If-ElseIf-Else statement allows to check for multiple conditions.
Loop: A loop is an essential control structure that repeats a set of instructions.
A finite loop is a set of instructions that repeats a certain number of times, and then it stops.
An infinite loop describes a series of instructions that repeats forever or until someone stops them.
There can be more than one algorithm to solve a problem.
Terms to Remember:Complex Problem: Complex problems are those which have many parts, require smart thinking, and can be solved in more than one ways. Decomposition means to break down a problem into smaller manageable parts. Abstraction ignores irrelevant information and details of a problem to be solved. Logical thinking is creation of a clear and organized plan of what to do, and in what order. Decision making is a process of making smart and good decisions in presence of challenging situations. Validation: Validation is a process of checking if algorithm really works as expected.
✎ Solved Exercise — Unit 3
Every question of the Exercise (printed pp 100–101), the Class Activity (printed pp 102–103) and both in-chapter Activity Time tasks (printed pp 82 and 96) is solved below in book order. Every algorithm and flowchart answer has been traced by hand before being written.
📗 Exercise Q1 — Encircle the correct answer (printed p 100)
Q1 (i–v) — Multiple choice printed p 100
Answers:
(i) Which of the following is not a part of computational thinking? — (a) Guesswork. The four parts are Decomposition, Abstraction and Logical Thinking (and Decision Making); guesswork is the opposite of computational thinking.
(ii) Which of the following is not a valid age? — (b) −5. An age can never be negative; 12, 30 and 18 are all valid ages.
(iii) Which of the following is an example of decomposition? — (b) Breaking puzzle into corners and edges. Splitting a task into smaller parts is decomposition; solving or colouring the whole puzzle at once is not.
(iv) Which symbol is used to show the Start or End of a flowchart? — (c) Oval (the Terminator). A rectangle is a process and a diamond is a decision.
(v) Why is it important to test an algorithm with correct and incorrect data? — (c) To make sure the algorithm produces right results in all cases.
📗 Exercise Q2 — Fill in the blanks (printed p 101)
Q2 (i–v) — Fill in the blanks printed p 101
Answers:
(i) To represent a process in a flowchart Rectangle symbol is used.
(ii) There are two types of loops. (Finite and infinite.)
(iii) Logical thinking is the process of organizing a plan where the tasks are organized in a clear and step-by-step order. (This is the book's own definition in Terms to Remember.)
(iv) There can be more than one (multiple) ways to solve a problem. (The Summary says: "There can be more than one algorithm to solve a problem.")
(v) If-ElseIf-Else statement allows to check for multiple conditions.
📗 Exercise Q3 — Descriptive answers (printed p 101)
Q3 (i) — Why do we use flowcharts if we already have the steps written as an algorithm? printed p 101
Model answer: A flowchart shows the same steps visually, as a diagram. The shapes show at a glance which step is an input, a process or a decision, and the arrows show the exact order and the paths a condition can take — including loops that go back to an earlier step. This makes branching and repetition much easier to understand, to explain to others, and to check for mistakes than lines of text. That is why the book's Instructions for Teachers say to introduce flowcharts alongside algorithms to visualize logic.
Q3 (ii) — Describe how loops are different from conditional statements printed p 101
Model answer: A conditional statement (If, If-Else, If-ElseIf-Else) makes a choice: it checks a condition once and selects which action to take; each step runs at most once. A loop creates repetition: it runs the same set of instructions again and again — a fixed number of times or until a goal is reached (finite loop), or forever until stopped (infinite loop). In short: conditions choose, loops repeat. The two often work together — the robot example uses a condition (is moisture low?) inside a loop (repeat for every plant).
Q3 (iii) — Why is algorithmic thinking important in real life, not just in computers? Give an example printed p 101
Model answer: Algorithmic thinking means breaking a big problem into clear, ordered steps that anyone can follow and check. In real life we use it whenever a task must be done correctly and in order: following a recipe, planning an event, or packing for a trip. Example (from the book): organizing Clean and Green Pakistan Day became manageable only after it was broken into parts (planning, cleaning, planting, awareness), the extras were ignored, and a step-by-step plan with smart decisions was made. The same thinking prevents mistakes anywhere, because unclear steps — like the unclear instruction "make a red car" — produce wrong results whether the follower is a robot or a person.
Q3 (iv) — Why is it important to test an algorithm with different inputs? printed p 101
Model answer: An algorithm may work for one input and fail for another. Testing with correct data (normal inputs, e.g. Age = 20) checks it gives the right result in normal use; testing with other valid values (e.g. Age = 17) checks the other branches; testing with incorrect data (wrong or extreme inputs, e.g. Age = −5) checks it does not produce a nonsense result and can show an error instead. Only if all cases behave correctly can we trust the algorithm — if a test fails, we fix the steps. (Caution from the book's own example on printed page 98: the expected output of a test must also be calculated correctly, or a good algorithm can look wrong.)
📗 Exercise Q4 — Draw flowcharts for the following tasks (printed p 101)
Q4 (i) — Flowchart that reads three numbers and displays the sum of these three numbers printed p 101
Draw it with the book's symbols (Table 3.1). The flow is:
Model flowchart (in words):Start (oval) → Input three numbers: A, B, C (parallelogram) → Sum = A + B + C (rectangle) → Display Sum (parallelogram) → Stop (oval). Check by tracing: A = 2, B = 3, C = 4 → Sum = 9 → displays 9 ✓.
Q4 (ii) — Flowchart that asks a user for a password; if the password is "SECRET" it says "Access Granted!", otherwise "Access Denied!" printed p 101
Draw it with an input symbol and one decision diamond:
Model flowchart (in words):Start (oval) → Input Password (parallelogram) → Is Password == "SECRET"? (diamond) — Yes → Display "Access Granted!" (parallelogram) → Stop; — No → Display "Access Denied!" (parallelogram) → Stop (oval).
Safety note: "SECRET" in this exercise is a pretend, made-up password printed in the book for practice. Never tell anyone your real passwords, never type a real password into an exercise, a website or a chat, and never use a word printed in a book as a real password — real passwords must be private and hard to guess.
Q4 (iii) — Flowchart to calculate the sum of the first 10 natural numbers printed p 101
This needs a finite loop with a counter and a running total:
Model flowchart (in words):Start (oval) → Set Sum = 0 (rectangle) → Set Counter = 1 (rectangle) → Is Counter <= 10? (diamond) — Yes → Sum = Sum + Counter (rectangle) → Counter = Counter + 1 (rectangle) → back to the diamond; — No → Display Sum (parallelogram) → Stop (oval). Check by tracing: Sum becomes 1, 3, 6, 10, 15, 21, 28, 36, 45, 55; when Counter = 11 the loop stops and displays 55 ✓ (1 + 2 + … + 10 = 55).
Q4 (iv) — Flowchart for a problem that keeps asking for a number until the user enters 0 printed p 101
The loop must ask first, then test — so the number 0 itself also gets entered and checked:
Model flowchart (in words):Start (oval) → Input a number, N (parallelogram) → Is N == 0? (diamond) — No → back to Input a number; — Yes → Stop (oval). Check by tracing: user enters 5 → not 0 → asks again; enters 3 → not 0 → asks again; enters 0 → Yes → Stop ✓. The loop repeats an unknown number of times but always stops when 0 is entered, so in the book's terms it is a loop that repeats until its goal is achieved.
📗 Exercise Q5 — Write algorithms for the following problems (printed p 101)
Q5 (i) — Algorithm that takes input of a number and checks if the number is positive, negative, or zero printed p 101
Three cases means an If-ElseIf-Else statement:
Model algorithm: Step-1: Start. Step-2: Input a number, N. Step-3: If N > 0, then: Print "Number is positive". Step-4: Else If N < 0, then: Print "Number is negative". Step-5: Else: Print "Number is zero". Step-6: End. Trace: N = 7 → positive ✓; N = −3 → negative ✓; N = 0 → not > 0 and not < 0 → zero ✓.
Q5 (ii) — Algorithm that reads the price of a book and displays the final discounted price after applying a 10% discount printed p 101
Book's hint: the 10% discount is calculated by multiplying the original price by 0.10 and then subtracting the resultant value from the original price.
Q5 (iii) — Zaviyar at a bookstore: 20% discount if the price of a book is more than 500 rupees, OR if Zaviyar is a student; otherwise no discount printed p 101
Either condition alone is enough for the discount — this is an OR condition:
Model algorithm: Step-1: Start. Step-2: Input price of book, Price. Step-3: Ask: Is Zaviyar a student? (Yes/No). Step-4: If Price > 500 OR Zaviyar is a student, then: Discount = Price × 0.20; FinalPrice = Price − Discount. Step-5: Else: FinalPrice = Price (no discount). Step-6: Print FinalPrice. Step-7: End. Trace all cases: Price = 600, not a student → 600 > 500 ✓ → Discount = 120 → pays 480. Price = 400, student → student ✓ → Discount = 80 → pays 320. Price = 400, not a student → neither condition → pays 400 (no discount) ✓.
Q5 (iv) — Algorithm that takes input of a name and prints it 10 times on screen printed p 101
A fixed count means a finite loop with a counter:
Model algorithm: Step-1: Start. Step-2: Input name, Name. Step-3: Set Counter = 1. Step-4: Repeat steps 5 to 6 while Counter <= 10: Step-5: Print Name. Step-6: Set Counter = Counter + 1. Step-7: End. Trace: prints when Counter is 1, 2, …, 10 — exactly 10 times; at Counter = 11 the loop stops ✓.
📗 Class Activity (printed pp 102–103)
Class Activity (i) — Draw a flowchart for the total-tax algorithm (10% sales tax on a mouse and a keyboard) printed p 102
The printed algorithm: Step-1: Input price of mouse, 'P1'. Step-2: Input price of keyboard, 'P2'. Step-3: Calculate tax on buying mouse, Tax1 = P1 × 0.10. Step-4: Calculate tax on buying keyboard, Tax2 = P2 × 0.10. Step-5: Calculate total tax, Total Tax = Tax1 + Tax2. Step-6: Print Total Tax. Step-7: End.
Model flowchart (in words):Start (oval) → Input price of mouse, P1 (parallelogram) → Input price of keyboard, P2 (parallelogram) → Tax1 = P1 × 0.10 (rectangle) → Tax2 = P2 × 0.10 (rectangle) → Total Tax = Tax1 + Tax2 (rectangle) → Print Total Tax (parallelogram) → Stop (oval). Check by tracing: P1 = 500, P2 = 1200 → Tax1 = 50, Tax2 = 120 → Total Tax = Rs. 170 ✓.
Class Activity (ii) — Finite or Infinite? (10 tasks) printed p 102
Answers (using the book's definitions: a finite loop repeats and then stops — including loops that repeat until a goal is achieved, printed p 87; an infinite loop repeats forever or until someone stops it):
S#
Task
Type of Loop
Why
1
Keep watering a plant UNTIL soil is wet
Finite
Stops when the goal (wet soil) is achieved
2
A game keeps going UNTIL a player's health reaches zero
Finite
Ends when health reaches zero
3
A computer program keeps checking for new emails continuously
Infinite
No end point; runs continuously like the book's security camera
4
A traffic light keeps changing colors repeatedly throughout a day
Infinite
Repeats continuously with no finishing step
5
A robot waters 3 plants, one after another
Finite
Fixed count: exactly 3 plants
6
Keep guessing my secret number UNTIL you guess correctly
Finite
Stops as soon as the guess is correct
7
Inaya practices math until she solves 10 problems
Finite
Fixed count: 10 problems
8
A robot keeps on sweeping floor until its battery runs low
Finite
Stops when the battery condition is met
9
Hamza does his homework until it is completed
Finite
Stops when the work is complete
10
Count down from 10 to 1
Finite
Fixed count: 10 numbers
Teacher's note: tasks 1, 2, 6, 8 and 9 repeat an unknown number of times, but each has a clear stopping condition, so the book counts them as finite — compare situation 2 for finite loops on printed page 87 ("brush our teeth until they get clean").
Class Activity (iii) — If, If-Else or If-ElseIf-Else? (10 tasks) printed p 103
Answers:
S#
Task
Type of Condition
Why
1
If password is correct, then login; else show error message
If-Else
Two choices: login or error
2
If user clicks "Submit", then save form
If
One action, no else part
3
If temperature > 40°C, show heat warning; else if temperature < 10°C, show cold warning; else show normal
If-ElseIf-Else
Multiple conditions checked in order
4
If file exists, open it
If
One action, no else part
5
Turn on fan if room is hot
If
One action when the condition is true
6
If payment is successful, show receipt; else show error
If-Else
Two choices: receipt or error
7
If traffic light is red, then stop; else go
If-Else
Two choices: stop or go
8
If mobile battery is low, show battery warning
If
One action, no else part
9
If student is late, mark absent; else mark present
If-Else
Two choices: absent or present
10
If Wi-Fi is connected, go online
If
One action, no else part
📗 In-chapter Activity Time tasks
Activity Time — Apply computational thinking to arrange elections for class monitor printed p 82
Model answer (suggested approach):Understand the problem: choose one class monitor fairly, simply and in a well-managed way. Break it down (decomposition): 1) announce rules and last date for names; 2) collect nominations; 3) prepare a voter list of the class; 4) make ballot papers (or a show-of-hands plan); 5) hold the vote; 6) count votes in front of two student witnesses and the teacher; 7) announce the result. Find patterns: the same steps — nominate, vote, count, announce — are reused in every school election. Ignore extras (abstraction): posters' colours and slogans do not affect fairness; the number of voters, one vote per student, and honest counting do. Make a plan / decisions: if two students tie, the teacher holds a second round between only those two; if a student is absent, the election still proceeds with the students present, as decided before voting starts.
Activity Time — Why are the "Unclear Instructions" not clear? printed p 96
Model answer:Task 1 (even or odd): "Take a number" does not say where the number comes from or what it is called; "Decide if it's even or odd" gives no method or condition for deciding — the clear version gives the exact test (N % 2 == 0); "Show result" does not say what to show — the clear version says display "Even" or "Odd". There is also no Start or End. Task 2 (average of 3 scores): "Get marks" does not say how many marks or their names; "Add them" is incomplete without knowing which values; "Find average" hides the actual calculation — the clear version shows total = score1 + score2 + score3 and average = total / 3. In both tasks the follower would have to guess, and a computer cannot guess (Rule-1).
✓ Practice Quiz — Algorithmic Thinking and Problem Solving
▶ Practice Set 1 · 10 Questions40 Pro Questions · Sets 2–5Timer includedEnglish explanations
One question at a time. The moment you answer, you see the correct answer and its explanation — practice exactly like the real exam. Practice Set 1 (10 questions) can be attempted by everyone; question and option order are shuffled on every attempt.
Question 1 of 1000:00
Your Result — Practice Set 1
0 / 10
100MCQs ProComing soon
40 more practice questions with Pro (Sets 2–5)
Rs. 250/month
The full unit has 50 questions in 5 sets. Pro will unlock all of them when it opens.
Everything in Free
All 40 remaining questions of this unit — computational thinking, algorithms and flowcharts, conditions, loops and validation
Every answer explained in English
Complete eligible practice sets — more opportunities to practise and strengthen your understanding
🧑🏫 Teacher's Guide — Unit 3: Algorithmic Thinking and Problem Solving
How to teach this unit: the book's own learning outcomes, a suggested teaching sequence, common misconceptions, activity guidance, marking rubrics, and the unit's correction and safety notes.
Learning Outcomes (as printed, p 78)
After the completion of this unit students will be able to:
Solve complex problems by applying computational thinking.
Understand different steps of computational thinking to solve a complex problem.
Define algorithms and provide simple real-life examples of algorithms.
Design algorithms for complex problems.
Draw flowcharts for representing algorithms.
Understand control structures including conditions and loops.
Apply conditions and loops for designing algorithms.
Infer clear instructions to produce correct results.
Analyze different ways to solve the same problem.
Understand and validate the algorithms to solve the problem.
Printed SLO prose is reproduced as printed; SLO codes are not printed in the book and have not been invented (SLO mapping is a separate editorial step).
Suggested Teaching Sequence
Start with life, not computers. Use the book's own openers — the Clean and Green Pakistan Day problem (p 79) and the class-monitor election activity (p 82) — so students meet decomposition, abstraction, logical thinking and decision making as thinking skills first.
Algorithm before flowchart. Teach the five algorithm rules and the Total Price algorithm (p 82), then introduce the six flowchart symbols (Table 3.1, p 83) and rebuild the same algorithms as diagrams. Students should be able to move both ways: steps ↔ diagram.
Trace everything on the board. For every loop in this unit, keep a counter table on the board (Counter value → action). The unit's own errors (below) were found by exactly this habit — model it.
Conditions ladder. If (one choice) → If-Else (two choices) → If-ElseIf-Else (a chain). Use the boundary cases: Marks = 50 passes under "Marks >= 50" (pp 84–85) but fails the strict grade chain on p 86, where 50 is not above 50. This contrast prevents the most common marking dispute.
Loops ladder. Fixed-count finite loops → goal-based finite loops → infinite loops (LED, temperature). Insist that every loop answer names its stopping condition — or states that it has none.
The robot lesson (pp 92–93) is the unit's centrepiece. Teach the correct step algorithm and while-form first, trace them, then show the printed flowchart and let students find its two defects themselves before revealing the correction (Lesson Part 14). This is validation taught by example.
Clear instructions. Run the LEGO examples (pp 93–96) as a live demo if possible: follow one deliberately vague instruction literally and let the class see the wrong result. Then apply Rules 1–5 to the p 96 activity table.
Close with validation. Finish with §3.8: students test the driving-age algorithm with 20, 17 and −5, and re-check the p 98 test table — including discovering that the book's expected output there is itself wrong (see the correction register).
Common Misconceptions to Watch For
"Until-goal loops are infinite." The book counts loops that repeat until a goal is achieved (brushing teeth until clean; watering until soil is wet) as finite, because they stop. Infinite means no stopping point at all.
Boundary blindness. Students often cannot say what happens at the exact boundary (Marks = 50, Age = 18, Price = 500 in the Zaviyar task — "more than 500" means 500 itself gets no discount unless the student condition applies). Always ask for the boundary case.
Forgetting the counter update. A loop whose counter never changes inside the loop never ends — exactly the second defect in the printed robot flowchart. Require students to point at the increment step in every loop they write.
Swapped Yes/No exits. The first defect in the printed robot flowchart. Have students trace the very first pass through every decision diamond with the starting values before accepting a flowchart.
Trusting the expected output. Validation fails if the expected answer is wrong (printed p 98). Teach students to calculate the expected output independently before running a test.
Guessing what the computer "means". Computers cannot guess (Rule-1). Vague steps like "add some wheels" are errors, not shortcuts.
Activity Guidance and Assessment
Class-monitor election activity (p 82) and the clear/unclear analysis (p 96) are solved in the Solved Exercise tab; accept any plan that names parts, ignores a genuine extra, and states decisions for a tie or an absence.
Class Activity classifications (pp 102–103) are solved with reasons. For the finite/infinite table, the deciding question is "does it stop, and by what condition?" — not "do we know how many times?"
Flowchart rubric (Q4 and Class Activity i): correct symbol for each step type (oval/rectangle/parallelogram/diamond); arrows in one clear order; decision diamonds with both exits labelled; loops that return to the correct earlier point; a trace with sample values that produces the right result (e.g. sum of 1–10 = 55).
Algorithm rubric (Q5): Start and End present; inputs named; conditions cover all cases (positive/negative/zero needs three branches); arithmetic shown as formulas (Discount = Price × 0.10) and verified with one traced example.
Extension: strong students can re-draw the corrected robot flowchart from Lesson Part 14 without looking, then swap with a partner and trace each other's version plant by plant.
Textbook Correction Register for This Unit
Printed p 98 — wrong expected total (student-visible correction in Lesson Part 20). The Key Terms table and the test table give 2800 as the expected total for prices 500, 1200 and 800. The true sum is 2500, which is also the total in the book's own algorithm on printed p 82. As printed, a correct algorithm would "fail" the test; the test data is at fault, not the algorithm. No practice question in this unit keys this arithmetic.
Printed p 93 — robot flowchart defective in two places (student-visible correction in Lesson Part 14). (1) The Yes/No exits of "Is PlantCounter > TotalPlants?" are swapped: as drawn, the robot stops immediately at PlantCounter = 1. (2) The skip path (moisture not low) returns without incrementing PlantCounter, trapping the robot on the first wet plant forever. The step algorithm and while-form on printed p 92 are correct; the Lesson teaches from them and shows a corrected, originally drawn flowchart.
Printed p 97 — even last digits listed incompletely in one sentence (student-visible correction in Lesson Part 19). The "Look last digit method" paragraph lists "0, 2, 4, 8", omitting 6; the book's own Algorithm 2 and Solution-2 on the same page include 6. The Lesson teaches the full set 0, 2, 4, 6, 8.
Printed p 91 — step algorithm and flowchart disagree (student-visible note in the Lesson). The printed step algorithm (Algorithm-2, temperature) contains no condition or stop test — it repeats Steps 3 to 5 forever, as the book's own callout states. The "Is condition true?" diamond and the Stop appear only in the printed flowchart. The Lesson teaches the flowchart's version and now notes the mismatch openly.
Printed p 96 — garbled example line (student-visible note in the Lesson). The §3.7 Algorithm 1 example line prints "Number = 8 8 ÷ 2 = 4 (remainder 0) → Even", with the number 8 printed twice. The working itself (8 ÷ 2 = 4, remainder 0, Even) is correct and is what the Lesson teaches.
Minor slips recorded (no student-facing change beyond clean presentation): printed p 82 step 5 contains a stray word "Algorithms" inside the sum line (the printed total 2500 is correct); printed p 85 flowchart carries a duplicated "No" label under the diamond (both exits are otherwise correctly drawn); printed pp 95–96 repeatedly print "Sep-" for "Step-" in the Rule-3/Rule-4 step lists.
Safety and Rights Notes
Passwords (Exercise Q4 ii): the book's example password is a fictional teaching word. The Solved Exercise carries a safety note: students must never share real passwords or use a printed word as a real password. Do not let students write real passwords in notebooks for this exercise.
No personal data tasks: this unit's exercises ask for no real personal or family information; keep it that way in class adaptations (use invented names, prices and ages).
Rights: lesson text follows the textbook closely for study purposes under the project's credit and disclaimer arrangement (see the credit block on the Lesson tab). The corrected robot flowchart in Lesson Part 14 is an original 100MCQs drawing made from the book's correct page-92 algorithm, not a copy of the printed diagram.
Help us improve this page. Spotted a mistake, or something that is not clear? Email us at [email protected] — every report helps the next student.