Algorithms: Flowcharts, Pseudocode and Hand Traces – Grade 13 A/L ICT Notes 9.3

© 2026 schoolict.net (Ruwan Mangala Suraweera)

9.3 Algorithms: Flowcharts, Pseudocode and Hand Tracesඇල්ගොරිතම: ගැලීම් සටහන්, ව්‍යාජ කේත සහ අත් අනුරේඛන

Grade 13 A/L ICT · Lesson 913 ශ්‍රේණිය A/L ICT · පාඩම 9

Prints all tabs in the language you are reading. Use “Save as PDF” in the print window to keep a copy.ඔබ කියවන භාෂාවෙන් සියලු tabs මුද්‍රණය වේ. පිටපතක් තියාගන්න print window එකේ “Save as PDF” තෝරන්න.
🎬Video coming soon in this language. Switch language to watch the other video.මේ භාෂාවෙන් වීඩියෝව ඉක්මනින් එනවා. අනෙක් වීඩියෝව බලන්න භාෂාව මාරු කරන්න.

In this videoමේ වීඩියෝවේ

  • An algorithm is a finite set of clear steps.ඇල්ගොරිතමය සීමිත පැහැදිලි පියවර ය.
  • Flowcharts use standard symbols.ගැලීම් සටහන් සම්මත සංකේත භාවිත කරයි.
  • Pseudocode is structured English.ව්‍යාජ කේතය ව්‍යුහගත ඉංග්‍රීසි ය.
  • Trace tables check values by hand.Trace table අතින් අගයන් පරීක්ෂා කරයි.
  • Trace before you code.කේතනයට පෙර අනුරේඛනය කරන්න.
AlgorithmFlowchartPseudocodeHand traceTrace tableTerminal symbolProcess symbol

Notesසටහන්

Syllabus 9.3. An algorithm is a finite, ordered set of clear steps that solves a problem. We show algorithms as flowcharts (standard symbols) or pseudocode (structured English), and check them with a hand trace (trace table) before coding.විෂය නිර්දේශය 9.3. ඇල්ගොරිතමයක් යනු ගැටලුවක් විසඳන සීමිත, පිළිවෙළ, පැහැදිලි පියවර කට්ටලයකි. අපි ඒවා ගැලීම් සටහන් (සම්මත සංකේත) හෝ ව්‍යාජ කේත ලෙස පෙන්වා කේතනයට පෙර අත් අනුරේඛනයක් (trace table) මගින් පරීක්ෂා කරමු.

1. Flowchart symbols1. ගැලීම් සටහන් සංකේත

Start / StopTerminalINPUT / DISPLAYInput / OutputTotal = A + BProcessMark >= 35?DecisionAConnectorFlow line
Standard flowchart symbolsසම්මත ගැලීම් සටහන් සංකේත

2. Finding the largest number2. විශාලතම සංඛ්‍යාව සෙවීම

Startlargest = numbers[0]more numbers?Yesn > largestlargest = nYesNoNoOUTPUT largestStop
Flowchart: find the largest numberගැලීම් සටහන: විශාලතම සංඛ්‍යාව

📝 Pseudocodeව්‍යාජ කේතය (Pseudocode)

BEGIN
  largest = first number
  FOR each number n DO
    IF n > largest THEN
      largest = n
    ENDIF
  ENDFOR
  DISPLAY largest
END

3. Hand trace3. අත් අනුරේඛනය

nnn > largest?n > largest?largestlargest
1212FalseFalse1212
4545TrueTrue4545
77FalseFalse4545
3030FalseFalse4545
🧮 Worked exampleවිසඳූ උදාහරණය Trace the algorithm for numbers [12, 45, 7, 30].[12, 45, 7, 30] සඳහා ඇල්ගොරිතමය අනුරේඛනය කරන්න.
largest starts at 12. Only 45 is greater, so largest becomes 45; 7 and 30 are not. Output 45 – the Python program below prints the same.largest 12 සිට ආරම්භ වේ. 45 පමණක් විශාල නිසා largest 45 වේ. ප්‍රතිදානය 45 – පහත Python වැඩසටහනද එයම මුද්‍රණය කරයි.

🐍 Find the largest numberවිශාලතම සංඛ්‍යාව සෙවීම

numbers = [12, 45, 7, 30]
largest = numbers[0]
for n in numbers:
    if n > largest:
        largest = n
print("Largest:", largest)

▶ Outputප්‍රතිදානය

Largest: 45
💡 A trace table has one column per variable and one row each time a value changes or a condition is tested.trace table එකක විචල්‍යයකට තීරුවක් සහ අගය වෙනස් වන සෑම විටම පේළියක් ඇත.
🚀 Beyond the syllabus (2026 update)🚀 විෂය නිර්දේශයෙන් ඔබ්බට (2026 යාවත්කාලීනය) Not required for the exam – read for interest.විභාගයට අවශ්‍ය නැත – දැනුම සඳහා කියවන්න. In 2026 visual debuggers draw live trace tables automatically, but exams still ask you to trace by hand.2026 visual debuggers ස්වයංක්‍රීයව trace tables අඳියි; නමුත් විභාගයේ අතින් අනුරේඛනය කළ යුතුය.

Key Wordsප්‍රධාන පද

Algorithmඇල්ගොරිතමය
Finite ordered unambiguous steps to solve a problem.ගැටලුවක් විසඳන සීමිත පිළිවෙළ පැහැදිලි පියවර.
Flowchartගැලීම් සටහන
Diagram of an algorithm using standard symbols.සම්මත සංකේත භාවිත කරන ඇල්ගොරිතම රූපය.
Pseudocodeව්‍යාජ කේතය
Structured English description of an algorithm.ඇල්ගොරිතමයක ව්‍යුහගත ඉංග්‍රීසි විස්තරය.
Hand traceඅත් අනුරේඛනය
Working through an algorithm by hand to check values.අගයන් පරීක්ෂාවට ඇල්ගොරිතමය අතින් ක්‍රියාත්මක කිරීම.
Trace tableTrace table
Table recording variable values during a trace.අනුරේඛනයේදී විචල්‍ය අගයන් සටහන් කරන වගුව.
Terminal symbolඅන්ත සංකේතය
Rounded box marking start or stop.ආරම්භය හෝ නැවතුම පෙන්වන රවුම් කොටුව.
Process symbolසැකසුම් සංකේතය
Rectangle for a calculation or assignment.ගණනය හෝ පැවරුම සඳහා සෘජුකෝණාස්‍රය.
Decision symbolතීරණ සංකේතය
Diamond with a yes/no condition.ඔව්/නැත කොන්දේසියක් සහිත දියමන්තිය.
Input/output symbolආදාන/ප්‍රතිදාන සංකේතය
Parallelogram for reading or displaying data.දත්ත කියවීම/පෙන්වීම සඳහා සමාන්තරාස්‍රය.
Flow lineගැලීම් රේඛාව
Arrow showing the order of steps.පියවර පිළිවෙළ පෙන්වන ඊතලය.
Connectorසම්බන්ධකය
Small circle joining parts of a flowchart.ගැලීම් සටහනේ කොටස් යා කරන කුඩා කවය.
Dry runවියළි ධාවනය
Another name for a hand trace without a computer.පරිගණකයක් නැතිව අනුරේඛනයට තවත් නමක්.

Sample Q&Aආදර්ශ ප්‍රශ්න සහ පිළිතුරු

1Define an algorithm.ඇල්ගොරිතමය?

Answerපිළිතුර: Finite ordered clear steps that solve a problem.සීමිත පිළිවෙළ පැහැදිලි පියවර.

2Which symbol shows a decision?තීරණ සංකේතය?

Answerපිළිතුර: Diamond.දියමන්තිය.

3Which symbol shows input or output?ආදාන/ප්‍රතිදාන?

Answerපිළිතුර: Parallelogram.සමාන්තරාස්‍රය.

4Output for [12, 45, 7, 30]?ප්‍රතිදානය?

Answerපිළිතුර: 45.45.

5How many times does largest change after the start?largest වෙනස් වන වාර?

Answerපිළිතුර: Once (12 → 45).එක් වරක්.

6Why hand trace?අත් අනුරේඛනය ඇයි?

Answerපිළිතුර: To find logic errors before coding.කේතනයට පෙර තාර්කික දෝෂ සෙවීමට.

MCQබහුවරණ ප්‍රශ්න

Choose the correct answer for each question.සෑම ප්‍රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.

Scoreලකුණු: 0 / 20

1A diamond in a flowchart shows aදියමන්තිය

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B

Decision.තීරණය.

2A parallelogram showsසමාන්තරාස්‍රය

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C

I/O.I/O.

3A rounded rectangle showsරවුම්

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D

Terminal.අන්තය.

4Structured English for an algorithm isව්‍යුහගත ඉංග්‍රීසි

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B

Pseudocode.ව්‍යාජ කේතය.

5The largest of [12, 45, 7, 30] isවිශාලතම

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E

45.45.

6In the trace, n > largest is True forTrue

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E

Only 45.45 පමණි.

7A table of variable values while checking an algorithm is aවගුව

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A

Trace table.Trace table.

8An algorithm must beඇල්ගොරිතමය

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C

Finite and clear.සීමිත, පැහැදිලි.

9Which term means: “Finite ordered unambiguous steps to solve a problem”?“ගැටලුවක් විසඳන සීමිත පිළිවෙළ පැහැදිලි පියවර” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A

Algorithm – Finite ordered unambiguous steps to solve a problem.ඇල්ගොරිතමය – ගැටලුවක් විසඳන සීමිත පිළිවෙළ පැහැදිලි පියවර.

10Which term means: “Diagram of an algorithm using standard symbols”?“සම්මත සංකේත භාවිත කරන ඇල්ගොරිතම රූපය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B

Flowchart – Diagram of an algorithm using standard symbols.ගැලීම් සටහන – සම්මත සංකේත භාවිත කරන ඇල්ගොරිතම රූපය.

11Which term means: “Structured English description of an algorithm”?“ඇල්ගොරිතමයක ව්‍යුහගත ඉංග්‍රීසි විස්තරය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A

Pseudocode – Structured English description of an algorithm.ව්‍යාජ කේතය – ඇල්ගොරිතමයක ව්‍යුහගත ඉංග්‍රීසි විස්තරය.

12Which term means: “Working through an algorithm by hand to check values”?“අගයන් පරීක්ෂාවට ඇල්ගොරිතමය අතින් ක්‍රියාත්මක කිරීම” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E

Hand trace – Working through an algorithm by hand to check values.අත් අනුරේඛනය – අගයන් පරීක්ෂාවට ඇල්ගොරිතමය අතින් ක්‍රියාත්මක කිරීම.

13Which term means: “Table recording variable values during a trace”?“අනුරේඛනයේදී විචල්‍ය අගයන් සටහන් කරන වගුව” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D

Trace table – Table recording variable values during a trace.Trace table – අනුරේඛනයේදී විචල්‍ය අගයන් සටහන් කරන වගුව.

14Which term means: “Rounded box marking start or stop”?“ආරම්භය හෝ නැවතුම පෙන්වන රවුම් කොටුව” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D

Terminal symbol – Rounded box marking start or stop.අන්ත සංකේතය – ආරම්භය හෝ නැවතුම පෙන්වන රවුම් කොටුව.

15Which term means: “Rectangle for a calculation or assignment”?“ගණනය හෝ පැවරුම සඳහා සෘජුකෝණාස්‍රය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C

Process symbol – Rectangle for a calculation or assignment.සැකසුම් සංකේතය – ගණනය හෝ පැවරුම සඳහා සෘජුකෝණාස්‍රය.

16Which term means: “Diamond with a yes/no condition”?“ඔව්/නැත කොන්දේසියක් සහිත දියමන්තිය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A

Decision symbol – Diamond with a yes/no condition.තීරණ සංකේතය – ඔව්/නැත කොන්දේසියක් සහිත දියමන්තිය.

17Which term means: “Parallelogram for reading or displaying data”?“දත්ත කියවීම/පෙන්වීම සඳහා සමාන්තරාස්‍රය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C

Input/output symbol – Parallelogram for reading or displaying data.ආදාන/ප්‍රතිදාන සංකේතය – දත්ත කියවීම/පෙන්වීම සඳහා සමාන්තරාස්‍රය.

18Which term means: “Arrow showing the order of steps”?“පියවර පිළිවෙළ පෙන්වන ඊතලය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D

Flow line – Arrow showing the order of steps.ගැලීම් රේඛාව – පියවර පිළිවෙළ පෙන්වන ඊතලය.

19Which term means: “Small circle joining parts of a flowchart”?“ගැලීම් සටහනේ කොටස් යා කරන කුඩා කවය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B

Connector – Small circle joining parts of a flowchart.සම්බන්ධකය – ගැලීම් සටහනේ කොටස් යා කරන කුඩා කවය.

20Which term means: “Another name for a hand trace without a computer”?“පරිගණකයක් නැතිව අනුරේඛනයට තවත් නමක්” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E

Dry run – Another name for a hand trace without a computer.වියළි ධාවනය – පරිගණකයක් නැතිව අනුරේඛනයට තවත් නමක්.

MCQ answer keyMCQ පිළිතුරු

  1. B – Decision.තීරණය.
  2. C – I/O.I/O.
  3. D – Terminal.අන්තය.
  4. B – Pseudocode.ව්‍යාජ කේතය.
  5. E – 45.45.
  6. E – Only 45.45 පමණි.
  7. A – Trace table.Trace table.
  8. C – Finite and clear.සීමිත, පැහැදිලි.
  9. A – Algorithm – Finite ordered unambiguous steps to solve a problem.ඇල්ගොරිතමය – ගැටලුවක් විසඳන සීමිත පිළිවෙළ පැහැදිලි පියවර.
  10. B – Flowchart – Diagram of an algorithm using standard symbols.ගැලීම් සටහන – සම්මත සංකේත භාවිත කරන ඇල්ගොරිතම රූපය.
  11. A – Pseudocode – Structured English description of an algorithm.ව්‍යාජ කේතය – ඇල්ගොරිතමයක ව්‍යුහගත ඉංග්‍රීසි විස්තරය.
  12. E – Hand trace – Working through an algorithm by hand to check values.අත් අනුරේඛනය – අගයන් පරීක්ෂාවට ඇල්ගොරිතමය අතින් ක්‍රියාත්මක කිරීම.
  13. D – Trace table – Table recording variable values during a trace.Trace table – අනුරේඛනයේදී විචල්‍ය අගයන් සටහන් කරන වගුව.
  14. D – Terminal symbol – Rounded box marking start or stop.අන්ත සංකේතය – ආරම්භය හෝ නැවතුම පෙන්වන රවුම් කොටුව.
  15. C – Process symbol – Rectangle for a calculation or assignment.සැකසුම් සංකේතය – ගණනය හෝ පැවරුම සඳහා සෘජුකෝණාස්‍රය.
  16. A – Decision symbol – Diamond with a yes/no condition.තීරණ සංකේතය – ඔව්/නැත කොන්දේසියක් සහිත දියමන්තිය.
  17. C – Input/output symbol – Parallelogram for reading or displaying data.ආදාන/ප්‍රතිදාන සංකේතය – දත්ත කියවීම/පෙන්වීම සඳහා සමාන්තරාස්‍රය.
  18. D – Flow line – Arrow showing the order of steps.ගැලීම් රේඛාව – පියවර පිළිවෙළ පෙන්වන ඊතලය.
  19. B – Connector – Small circle joining parts of a flowchart.සම්බන්ධකය – ගැලීම් සටහනේ කොටස් යා කරන කුඩා කවය.
  20. E – Dry run – Another name for a hand trace without a computer.වියළි ධාවනය – පරිගණකයක් නැතිව අනුරේඛනයට තවත් නමක්.

Structured Questionsව්‍යුහගත ප්‍රශ්න

1Draw and name five flowchart symbols.සංකේත පහ. (5 marksලකුණු 5)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Terminal; process; decision; input/output; flow line/connector.අන්ත; සැකසුම; තීරණ; I/O; රේඛා.

2Write pseudocode to find the largest of a list.විශාලතම pseudocode. (4 marksලකුණු 4)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
largest = first; FOR each n; IF n > largest THEN largest = n; DISPLAY.largest; FOR; IF; DISPLAY.

3Draw a flowchart to find the largest of a list.ගැලීම් සටහන. (6 marksලකුණු 6)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Start; set largest; loop decision; compare decision; output; stop.Start; ලූපය; තීරණ; ප්‍රතිදානය.

4Complete a trace table for [12, 45, 7, 30].trace table. (5 marksලකුණු 5)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
12 F 12; 45 T 45; 7 F 45; 30 F 45; output 45.පේළි 4; 45.

5State three properties of a good algorithm.ගුණාංග තුනක්. (3 marksලකුණු 3)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Finite; unambiguous; ordered steps with input/output.සීමිත; පැහැදිලි; පිළිවෙළ.

🎮 Game🎮 ක්‍රීඩා

Pick a game. Each one uses words from this lesson.ක්‍රීඩාවක් තෝරන්න. හැම එකක්ම මේ පාඩමේ වචන පාවිච්චි කරනවා.

Summary & Downloadsසාරාංශය සහ බාගත කිරීම්

Key pointsප්‍රධාන කරුණු

  • An algorithm is a finite set of clear steps.ඇල්ගොරිතමය සීමිත පැහැදිලි පියවර ය.
  • Flowcharts use standard symbols.ගැලීම් සටහන් සම්මත සංකේත භාවිත කරයි.
  • Pseudocode is structured English.ව්‍යාජ කේතය ව්‍යුහගත ඉංග්‍රීසි ය.
  • Trace tables check values by hand.Trace table අතින් අගයන් පරීක්ෂා කරයි.
  • Trace before you code.කේතනයට පෙර අනුරේඛනය කරන්න.

Downloadsබාගත කිරීම්

Full Lesson 9 PDFසම්පූර්ණ පාඩම 9 PDF: English · සිංහල

Next noteඊළඟ සටහන 9.4 →

© 2026 schoolict.net (Ruwan Mangala Suraweera). All rights reserved.සියලු හිමිකම් ඇවිරිණි.

Resource Book Lesson Note Download Questions Syllabus Sinhala LMS Simulator Tool