Top-Down Design, Stepwise Refinement and Structure Charts – Grade 13 A/L ICT Notes 9.2

© 2026 schoolict.net (Ruwan Mangala Suraweera)

9.2 Top-Down Design, Stepwise Refinement and Structure ChartsTop-down සැලසුම, පියවරෙන් පියවර පිරිපහදුව සහ ව්‍යුහ සටහන්

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මේ වීඩියෝවේ

  • Modularisation splits programs into modules.මොඩියුලකරණය වැඩසටහන් මොඩියුලවලට බෙදයි.
  • Top-down: whole problem first.Top-down: මුලින් සම්පූර්ණ ගැටලුව.
  • Stepwise refinement adds detail step by step.පිරිපහදුව පියවරෙන් පියවර විස්තර එක් කරයි.
  • Structure charts show modules and calls.ව්‍යුහ සටහන් මොඩියුල සහ කැඳවීම් පෙන්වයි.
  • Each module becomes a function.සෑම මොඩියුලයක්ම ශ්‍රිතයක් වේ.
ModularisationModuleTop-down designStepwise refinementStructure chartMain moduleSub-module

Notesසටහන්

Syllabus 9.2. Big problems are easier when split into smaller parts. Modularisation divides a program into modules; top-down design starts with the whole task and stepwise refinement breaks each step into smaller steps until each can be coded. A structure chart shows the modules and how they call each other.විෂය නිර්දේශය 9.2. විශාල ගැටලු කුඩා කොටස්වලට බෙදූ විට පහසුය. මොඩියුලකරණය වැඩසටහනක් මොඩියුලවලට බෙදයි; top-down සැලසුම සම්පූර්ණ කාර්යයෙන් ආරම්භ කර පියවරෙන් පියවර පිරිපහදුව එක් එක් පියවර කේතනය කළ හැකි තෙක් කුඩා කරයි. ව්‍යුහ සටහන මොඩියුල සහ ඒවා එකිනෙක කැඳවන ආකාරය පෙන්වයි.

1. Stepwise refinement1. පියවරෙන් පියවර පිරිපහදුව

📝 Refining the task step by stepකාර්යය පියවරෙන් පියවර පිරිපහදු කිරීම

1 Produce a class report
  1.1 Get the marks
  1.2 Calculate the average
      1.2.1 Add all marks
      1.2.2 Divide by the number of marks
  1.3 Find the grade
      1.3.1 IF average >= 75 THEN A
      1.3.2 ELSE IF average >= 50 THEN C ELSE F
  1.4 Print the report

2. Structure chart2. ව්‍යුහ සටහන

Structure chart (top-down design)Produce reportGet marksCalculateaverageFind gradePrint reportmarks ↓↑ gradeEach box is a module; lines show which module calls which; arrows on lines show data passed.
Structure chart for the class reportපන්ති වාර්තාව සඳහා ව්‍යුහ සටහන
  • Each rectangle is a module (a function in Python).සෑම සෘජුකෝණාස්‍රයක්ම මොඩියුලයකි (Python හි ශ්‍රිතයක්).
  • Lines join a calling module to the modules it calls.රේඛා කැඳවන මොඩියුලය කැඳවනු ලබන ඒවාට යා කරයි.
  • Small arrows show data passed down (marks) and back up (grade).කුඩා ඊතල පහළට (marks) සහ ඉහළට (grade) යවන දත්ත පෙන්වයි.

3. Each module becomes a function3. සෑම මොඩියුලයක්ම ශ්‍රිතයක් වේ

🐍 Top-down: a report built from small functionsTop-down: කුඩා ශ්‍රිතවලින් සාදන වාර්තාව

def get_marks():
    return [78, 45, 88, 62, 39]

def average(marks):
    return sum(marks) / len(marks)

def grade(avg):
    if avg >= 75:
        return "A"
    elif avg >= 50:
        return "C"
    return "F"

def report():
    marks = get_marks()
    avg = average(marks)
    print("Average:", avg)
    print("Grade:", grade(avg))

report()

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

Average: 62.4
Grade: C
🧮 Worked exampleවිසඳූ උදාහරණය What does the modular program print, and which module decides it?මොඩියුල වැඩසටහන මුද්‍රණය කරන්නේ කුමක්ද?
average() returns (78 + 45 + 88 + 62 + 39) ÷ 5 = 62.4. grade() sees 62.4 ≥ 50 but < 75, so it returns C. report() prints both.average() = 62.4; grade() 62.4 ≥ 50 නමුත් < 75 නිසා C; report() දෙකම මුද්‍රණය කරයි.
💡 Benefits of modules: easier testing, reuse, teamwork and simpler maintenance.මොඩියුලවල වාසි: පහසු පරීක්ෂාව, නැවත භාවිතය, කණ්ඩායම් වැඩ සහ පහසු නඩත්තුව.
🚀 Beyond the syllabus (2026 update)🚀 විෂය නිර්දේශයෙන් ඔබ්බට (2026 යාවත්කාලීනය) Not required for the exam – read for interest.විභාගයට අවශ්‍ය නැත – දැනුම සඳහා කියවන්න. Large 2026 apps are split into microservices – the same top-down idea at the scale of whole servers.2026 විශාල යෙදුම් microservices ලෙස බෙදා ඇත – එකම top-down අදහස සේවාදායක මට්ටමින්.

Key Wordsප්‍රධාන පද

Modularisationමොඩියුලකරණය
Dividing a program into separate modules.වැඩසටහනක් වෙන් මොඩියුලවලට බෙදීම.
Moduleමොඩියුලය
Self-contained part of a program that does one task.එක් කාර්යයක් කරන ස්වාධීන කොටස.
Top-down designTop-down සැලසුම
Starting with the whole problem and dividing it into parts.සම්පූර්ණ ගැටලුවෙන් ආරම්භ කර කොටස්වලට බෙදීම.
Stepwise refinementපියවරෙන් පියවර පිරිපහදුව
Breaking each step into smaller, more detailed steps.සෑම පියවරක්ම කුඩා විස්තරාත්මක පියවරවලට බෙදීම.
Structure chartව්‍යුහ සටහන
Diagram of modules and their calling hierarchy.මොඩියුල සහ කැඳවීමේ ධුරාවලියේ රූපය.
Main moduleප්‍රධාන මොඩියුලය
Top module that controls the sub-modules.උප මොඩියුල පාලනය කරන ඉහළම මොඩියුලය.
Sub-moduleඋප මොඩියුලය
Module called by a higher module.ඉහළ මොඩියුලයක් කැඳවන මොඩියුලය.
Data coupleදත්ත යුගලය
Arrow on a structure chart showing data passed.යවන දත්ත පෙන්වන ව්‍යුහ සටහනේ ඊතලය.
Reuseනැවත භාවිතය
Using the same module in more than one place.එකම මොඩියුලය ස්ථාන කිහිපයක භාවිතය.
Functionශ්‍රිතය
Named block of code that can be called.කැඳවිය හැකි නම් කළ කේත කොටස.
Bottom-up designBottom-up සැලසුම
Building small parts first and combining them.කුඩා කොටස් මුලින් සාදා එකතු කිරීම.
Decompositionවියෝජනය
Breaking a complex problem into simpler ones.සංකීර්ණ ගැටලුවක් සරල ඒවාට බිඳීම.

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

1What is stepwise refinement?පියවරෙන් පියවර පිරිපහදුව?

Answerපිළිතුර: Breaking each step into smaller steps until each can be coded.කේතනය කළ හැකි තෙක් පියවර කුඩා කිරීම.

2What does a structure chart show?ව්‍යුහ සටහන?

Answerපිළිතුර: Modules, who calls whom and data passed.මොඩියුල, කැඳවීම්, දත්ත.

3Two benefits of modularisation?වාසි දෙකක්?

Answerපිළිතුර: Easier testing and reuse.පහසු පරීක්ෂාව සහ නැවත භාවිතය.

4Average in the modular program?සාමාන්‍යය?

Answerපිළිතුර: 62.4.62.4.

5Grade printed?ශ්‍රේණිය?

Answerපිළිතුර: C.C.

6Top-down vs bottom-up?Top-down සහ bottom-up?

Answerපිළිතුර: Top-down splits the whole; bottom-up builds parts then combines.Top-down බෙදයි; bottom-up එකතු කරයි.

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

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

Scoreලකුණු: 0 / 20

1Starting from the whole problem and splitting it isසම්පූර්ණයෙන් ආරම්භ

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

Top-down.Top-down.

2Breaking steps into smaller detailed steps isකුඩා පියවර

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

Refinement.පිරිපහදුව.

3A diagram of modules and calls is aමොඩියුල රූපය

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

Structure chart.ව්‍යුහ සටහන.

4In Python a module of a structure chart is usually written as aPython

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

Function.ශ්‍රිතය.

5The modular program prints averageසාමාන්‍යය

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

312 ÷ 5.312 ÷ 5.

6The modular program prints gradeශ්‍රේණිය

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

50 ≤ 62.4 < 75.50 ≤ 62.4 < 75.

7Arrows beside the lines of a structure chart showඊතල

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

Data couples.දත්ත යුගල.

8Which is NOT a benefit of modularisation?වාසියක් නොවේ

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

Speed is not guaranteed.වේගය සහතික නැත.

9Which term means: “Dividing a program into separate modules”?“වැඩසටහනක් වෙන් මොඩියුලවලට බෙදීම” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Modularisation – Dividing a program into separate modules.මොඩියුලකරණය – වැඩසටහනක් වෙන් මොඩියුලවලට බෙදීම.

10Which term means: “Self-contained part of a program that does one task”?“එක් කාර්යයක් කරන ස්වාධීන කොටස” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Module – Self-contained part of a program that does one task.මොඩියුලය – එක් කාර්යයක් කරන ස්වාධීන කොටස.

11Which term means: “Starting with the whole problem and dividing it into parts”?“සම්පූර්ණ ගැටලුවෙන් ආරම්භ කර කොටස්වලට බෙදීම” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Top-down design – Starting with the whole problem and dividing it into parts.Top-down සැලසුම – සම්පූර්ණ ගැටලුවෙන් ආරම්භ කර කොටස්වලට බෙදීම.

12Which term means: “Breaking each step into smaller, more detailed steps”?“සෑම පියවරක්ම කුඩා විස්තරාත්මක පියවරවලට බෙදීම” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Stepwise refinement – Breaking each step into smaller, more detailed steps.පියවරෙන් පියවර පිරිපහදුව – සෑම පියවරක්ම කුඩා විස්තරාත්මක පියවරවලට බෙදීම.

13Which term means: “Diagram of modules and their calling hierarchy”?“මොඩියුල සහ කැඳවීමේ ධුරාවලියේ රූපය” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Structure chart – Diagram of modules and their calling hierarchy.ව්‍යුහ සටහන – මොඩියුල සහ කැඳවීමේ ධුරාවලියේ රූපය.

14Which term means: “Top module that controls the sub-modules”?“උප මොඩියුල පාලනය කරන ඉහළම මොඩියුලය” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Main module – Top module that controls the sub-modules.ප්‍රධාන මොඩියුලය – උප මොඩියුල පාලනය කරන ඉහළම මොඩියුලය.

15Which term means: “Module called by a higher module”?“ඉහළ මොඩියුලයක් කැඳවන මොඩියුලය” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Sub-module – Module called by a higher module.උප මොඩියුලය – ඉහළ මොඩියුලයක් කැඳවන මොඩියුලය.

16Which term means: “Arrow on a structure chart showing data passed”?“යවන දත්ත පෙන්වන ව්‍යුහ සටහනේ ඊතලය” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Data couple – Arrow on a structure chart showing data passed.දත්ත යුගලය – යවන දත්ත පෙන්වන ව්‍යුහ සටහනේ ඊතලය.

17Which term means: “Using the same module in more than one place”?“එකම මොඩියුලය ස්ථාන කිහිපයක භාවිතය” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Reuse – Using the same module in more than one place.නැවත භාවිතය – එකම මොඩියුලය ස්ථාන කිහිපයක භාවිතය.

18Which term means: “Named block of code that can be called”?“කැඳවිය හැකි නම් කළ කේත කොටස” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Function – Named block of code that can be called.ශ්‍රිතය – කැඳවිය හැකි නම් කළ කේත කොටස.

19Which term means: “Building small parts first and combining them”?“කුඩා කොටස් මුලින් සාදා එකතු කිරීම” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Bottom-up design – Building small parts first and combining them.Bottom-up සැලසුම – කුඩා කොටස් මුලින් සාදා එකතු කිරීම.

20Which term means: “Breaking a complex problem into simpler ones”?“සංකීර්ණ ගැටලුවක් සරල ඒවාට බිඳීම” යන්නෙන් අදහස් වන පදය කුමක්ද?

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

Decomposition – Breaking a complex problem into simpler ones.වියෝජනය – සංකීර්ණ ගැටලුවක් සරල ඒවාට බිඳීම.

MCQ answer keyMCQ පිළිතුරු

  1. A – Top-down.Top-down.
  2. B – Refinement.පිරිපහදුව.
  3. A – Structure chart.ව්‍යුහ සටහන.
  4. C – Function.ශ්‍රිතය.
  5. B – 312 ÷ 5.312 ÷ 5.
  6. D – 50 ≤ 62.4 < 75.50 ≤ 62.4 < 75.
  7. A – Data couples.දත්ත යුගල.
  8. E – Speed is not guaranteed.වේගය සහතික නැත.
  9. A – Modularisation – Dividing a program into separate modules.මොඩියුලකරණය – වැඩසටහනක් වෙන් මොඩියුලවලට බෙදීම.
  10. B – Module – Self-contained part of a program that does one task.මොඩියුලය – එක් කාර්යයක් කරන ස්වාධීන කොටස.
  11. D – Top-down design – Starting with the whole problem and dividing it into parts.Top-down සැලසුම – සම්පූර්ණ ගැටලුවෙන් ආරම්භ කර කොටස්වලට බෙදීම.
  12. E – Stepwise refinement – Breaking each step into smaller, more detailed steps.පියවරෙන් පියවර පිරිපහදුව – සෑම පියවරක්ම කුඩා විස්තරාත්මක පියවරවලට බෙදීම.
  13. E – Structure chart – Diagram of modules and their calling hierarchy.ව්‍යුහ සටහන – මොඩියුල සහ කැඳවීමේ ධුරාවලියේ රූපය.
  14. B – Main module – Top module that controls the sub-modules.ප්‍රධාන මොඩියුලය – උප මොඩියුල පාලනය කරන ඉහළම මොඩියුලය.
  15. D – Sub-module – Module called by a higher module.උප මොඩියුලය – ඉහළ මොඩියුලයක් කැඳවන මොඩියුලය.
  16. C – Data couple – Arrow on a structure chart showing data passed.දත්ත යුගලය – යවන දත්ත පෙන්වන ව්‍යුහ සටහනේ ඊතලය.
  17. D – Reuse – Using the same module in more than one place.නැවත භාවිතය – එකම මොඩියුලය ස්ථාන කිහිපයක භාවිතය.
  18. C – Function – Named block of code that can be called.ශ්‍රිතය – කැඳවිය හැකි නම් කළ කේත කොටස.
  19. C – Bottom-up design – Building small parts first and combining them.Bottom-up සැලසුම – කුඩා කොටස් මුලින් සාදා එකතු කිරීම.
  20. E – Decomposition – Breaking a complex problem into simpler ones.වියෝජනය – සංකීර්ණ ගැටලුවක් සරල ඒවාට බිඳීම.

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

1Explain top-down design and stepwise refinement.Top-down සහ පිරිපහදුව. (3 marksලකුණු 3)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Whole to parts; refine each step; until codable.සම්පූර්ණ → කොටස්; පිරිපහදුව.

2Refine “calculate average” into smaller steps.“සාමාන්‍යය” පිරිපහදුව. (3 marksලකුණු 3)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Add all marks; count them; divide total by count.එකතු; ගණන් කිරීම; බෙදීම.

3Draw a structure chart for producing a class report.ව්‍යුහ සටහන. (3 marksලකුණු 3)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Main Produce report; Get marks, Calculate average, Find grade, Print report; data couples.ප්‍රධාන; උප මොඩියුල 4; දත්ත.

4State three benefits of modularisation.වාසි තුනක්. (3 marksලකුණු 3)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Testing; reuse; teamwork/maintenance.පරීක්ෂාව; නැවත භාවිතය; නඩත්තුව.

5Write a Python function grade(avg) returning A, C or F.grade() ශ්‍රිතය. (4 marksලකුණු 4)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
def grade(avg); if avg >= 75 return A; elif avg >= 50 return C; return F.def; if; elif; return.

🎮 Game🎮 ක්‍රීඩා

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

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

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

  • Modularisation splits programs into modules.මොඩියුලකරණය වැඩසටහන් මොඩියුලවලට බෙදයි.
  • Top-down: whole problem first.Top-down: මුලින් සම්පූර්ණ ගැටලුව.
  • Stepwise refinement adds detail step by step.පිරිපහදුව පියවරෙන් පියවර විස්තර එක් කරයි.
  • Structure charts show modules and calls.ව්‍යුහ සටහන් මොඩියුල සහ කැඳවීම් පෙන්වයි.
  • Each module becomes a function.සෑම මොඩියුලයක්ම ශ්‍රිතයක් වේ.

Downloadsබාගත කිරීම්

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

Next noteඊළඟ සටහන 9.3 →

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