© 2026 schoolict.net (Ruwan Mangala Suraweera)
Lesson 9 A/L Exam Practice: Questions and Answersපාඩම 9 A/L විභාග පුහුණුව: ප්රශ්න සහ පිළිතුරු
Grade 13 A/L ICT · Lesson 913 ශ්රේණිය A/L ICT · පාඩම 9
Paper I MCQPaper I බහුවරණ
This practice paper assesses Lesson 9: Programming (syllabus competency 9). Paper I has 30 five-option MCQs. Paper II Part A has four structured questions; Part B has three essays. Marking points are shown in brackets. Every Python answer was checked by running it.මෙම පුහුණු පත්රය පාඩම 9: ක්රමලේඛනය (නිපුණතාව 9) ඇගයීමටය. Paper I හි MCQ 30; Paper II ව්යුහගත හතරක් සහ රචනා තුනක්. සෑම Python පිළිතුරක්ම ධාවනය කර පරීක්ෂා කර ඇත.
Choose one answer for each question. The explanation appears after you answer. Time guide: about 45 minutes (1½ minutes each).සෑම ප්රශ්නයකටම එක් පිළිතුරක් තෝරන්න. පිළිතුරු දුන් පසු පැහැදිලි කිරීම පෙන්වයි. කාල මාර්ගෝපදේශය: විනාඩි 45 පමණ (එකකට විනාඩි 1½).
1Breaking a problem into smaller sub-problems isකුඩා කොටස්
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Top-down.Top-down.
2A diagram showing modules and their sub-modules is amodules
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Structure chart.ව්යුහ සටහන.
3In a flowchart a decision is drawn as aතීරණය
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Diamond.දියමන්තිය.
4Input and output in a flowchart use aආදානය
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Parallelogram.සමාන්තරාස්රය.
5The largest of [12, 45, 7, 30] found by the trace isවිශාලතම
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Compare each.සසඳන්න.
6Machine code is aMachine code
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
1GL.1GL.
7Prolog is mainly aProlog
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Logic.තාර්කික.
8A translator that converts the whole program before running is aසම්පූර්ණ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Compiler.Compiler.
9A translator that runs a program line by line is anපේළියෙන්
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Interpreter.Interpreter.
10Joining object code with library code is done by alibrary
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Linker.Linker.
11A program that runs but gives a wrong answer has aවැරදි පිළිතුර
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Logic.තාර්කික.
12Pausing a program at a chosen line in an IDE uses aනවත්වන
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Breakpoint.Breakpoint.
137 // 2 in Python gives7 // 2
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Floor division.පූර්ණ බෙදීම.
142 3 2 in Python gives2 3 2
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Right to left.දකුණේ සිට.
155 · 3 (bitwise XOR) gives5 · 3
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
101 XOR 011.101 XOR 011.
16The data type of 3.6 is3.6
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Float.Float.
17if / elif / else is an example ofif
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Selection.වරණය.
18The digit-sum loop prints for 472472
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
4 + 7 + 2.4 + 7 + 2.
19range(1, 4) producesrange
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Stop excluded.4 නැත.
20total_price(3) with price=100 by default returnstotal_price
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
3 × 100.3 × 100.
21A variable that exists only while its function runs islocal
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Local.Local.
22For s = “Sri Lanka”, s[4:9] isslice
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Index 4–8.4–8.
23Which structure cannot be changed after creation?tuple
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Tuple.Tuple.
24Key → value pairs are stored in akey
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Dictionary.ශබ්දකෝෂය.
25Which file mode adds data to the end?අගට
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Append.Append.
26The files program prints TotalTotal
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
78 + 45 + 88.78 + 45 + 88.
27Changes made through sqlite3 are saved byසුරැකීම
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Commit.Commit.
28Sequential search for 23 in [34, 7, 23, 32, 5, 62] needs23
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
34, 7, 23.34, 7, 23.
29After pass 1 of bubble sort, [5, 1, 4, 2, 8] becomespass 1
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
5 moves right.5 දකුණට.
30Total swaps when bubble sorting [5, 1, 4, 2, 8] areහුවමාරු
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
3 + 1.3 + 1.
Paper II Part APaper II A කොටස
Part A: answer all four questions. Marks for each part are shown in brackets. Try first, then open the model answer.A කොටස: ප්රශ්න හතරටම පිළිතුරු දෙන්න. එක් එක් කොටසේ ලකුණු වරහන් තුළ ඇත. මුලින් උත්සාහ කර පසුව ආදර්ශ පිළිතුර විවෘත කරන්න.
1Problem solving and algorithmsගැටලු විසඳීම සහ ඇල්ගොරිතම (8 marksලකුණු 8)
- (i) State the steps of problem solving.පියවර. (2 marksලකුණු 2)
- (ii) Draw a flowchart that finds the largest of a list of numbers.ගැලීම් සටහන. (3 marksලකුණු 3)
- (iii) Trace the algorithm for [12, 45, 7, 30] and give the output.අනුරේඛනය. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
(i) (2 marksලකුණු 2)
Understand, plan (1); implement, test and evaluate (1).(2).
(ii) (3 marksලකුණු 3)
Initialise largest (1); loop with decision n > largest (1); output (1).(3).
(iii) (3 marksලකුණු 3)
Rows for each n (2); output 45 (1).(3).
2Languages and translatorsභාෂා සහ පරිවර්තක (8 marksලකුණු 8)
- (i) Compare compilers and interpreters (three points).compiler සහ interpreter. (3 marksලකුණු 3)
- (ii) Explain the role of a linker.linker. (2 marksලකුණු 2)
- (iii) Name three programming paradigms with an example language each.paradigms. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
(i) (3 marksලකුණු 3)
Whole program vs line (1); speed (1); error reporting (1).(3).
(ii) (2 marksලකුණු 2)
Joins object code (1); with libraries into an executable (1).(2).
(iii) (3 marksලකුණු 3)
Procedural C (1); object-oriented Java/Python (1); logic Prolog or functional Haskell (1).(3).
3Python basics and controlPython මූලික සහ පාලනය (8 marksලකුණු 8)
- (i) Evaluate 7 // 2, 7 % 2 and 2 3 2.ගණනය කරන්න. (3 marksලකුණු 3)
- (ii) Write a while loop that prints the digit sum of 472.while ලූපය. (3 marksලකුණු 3)
- (iii) Distinguish iteration and looping.iteration සහ looping. (2 marksලකුණු 2)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
(i) (3 marksලකුණු 3)
3 (1); 1 (1); 512 (1).(3).
(ii) (3 marksලකුණු 3)
while n > 0 (1); add n % 10 and n //= 10 (1); prints 13 (1).(3).
(iii) (2 marksලකුණු 2)
Count-controlled for (1); condition-controlled while (1).(2).
4Functions and data structuresශ්රිත සහ දත්ත ව්යුහ (8 marksලකුණු 8)
- (i) Write a function with a default parameter and show two calls.පෙරනිමි පරාමිතිය. (3 marksලකුණු 3)
- (ii) Compare local and global variables.local සහ global. (2 marksලකුණු 2)
- (iii) Write code that counts words using a dictionary.වචන ගණන. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
(i) (3 marksලකුණු 3)
def with price=100 (1); return (1); 300 and 750 (1).(3).
(ii) (2 marksලකුණු 2)
Where created / scope (1); lifetime (1).(2).
(iii) (3 marksලකුණු 3)
split (1); freq.get(w, 0) + 1 (1); red 3, blue 1, green 1 (1).(3).
Paper II Part BPaper II B කොටස
Part B: essay questions. Write full answers in paragraphs. Marks for each part are shown in brackets.B කොටස: රචනා ප්රශ්න. ඡේද ලෙස සම්පූර්ණ පිළිතුරු ලියන්න. එක් එක් කොටසේ ලකුණු වරහන් තුළ ඇත.
1Developing a marks programලකුණු වැඩසටහනක් සංවර්ධනය (10 marksලකුණු 10)
- (i) Use top-down design to break a marks program into modules and draw a structure chart.structure chart. (3 marksලකුණු 3)
- (ii) Write Python to read five marks into a list and print the average.සාමාන්යය. (4 marksලකුණු 4)
- (iii) Explain syntax, runtime and logic errors and how an IDE helps find them.දෝෂ. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
(i) (3 marksලකුණු 3)
Modules input, process, output (2); chart (1).(3).
(ii) (4 marksලකුණු 4)
Loop input (1); int and append (1); sum / len (1); print (1).(4).
(iii) (3 marksලකුණු 3)
Three errors defined (2); breakpoint / step / watch (1).(3).
2Files and databasesගොනු සහ දත්ත සමුදා (10 marksලකුණු 10)
- (i) Explain the r, w and a file modes.modes. (3 marksලකුණු 3)
- (ii) Write a program that appends a mark to marks.txt and then prints the total of all marks.ගොනු වැඩසටහන. (4 marksලකුණු 4)
- (iii) Describe the steps to add, modify, delete and retrieve records with sqlite3.sqlite3. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
(i) (3 marksලකුණු 3)
r (1); w (1); a (1).(3).
(ii) (4 marksලකුණු 4)
open a, write, close (1); open r (1); split and int (1); total 211 style output (1).(4).
(iii) (3 marksලකුණු 3)
connect and cursor (1); INSERT/UPDATE/DELETE with commit (1); SELECT and close (1).(3).
3Searching and sortingසෙවීම සහ වර්ග කිරීම (11 marksලකුණු 11)
- (i) Write a sequential search function and explain why it returns -1.සෙවීම. (3 marksලකුණු 3)
- (ii) Find 23 and 99 in [34, 7, 23, 32, 5, 62] and count the comparisons.23 සහ 99. (2 marksලකුණු 2)
- (iii) Write bubble sort with a swapped flag and show every pass for [5, 1, 4, 2, 8].bubble sort. (6 marksලකුණු 6)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
(i) (3 marksලකුණු 3)
for loop (1); return index (1); -1 when not found (1).(3).
(ii) (2 marksලකුණු 2)
23: index 2, 3 comparisons (1); 99: -1, 6 comparisons (1).(2).
(iii) (6 marksලකුණු 6)
Nested loops (2); swap (1); flag stop (1); passes [1, 4, 2, 5, 8], [1, 2, 4, 5, 8], [1, 2, 4, 5, 8] (2).(6).
Exam Tipsවිභාග උපදෙස්
- Steps: understand, plan, implement, test.පියවර: තේරුම්, සැලසුම්, ක්රියාත්මක, පරීක්ෂා.
- Know every flowchart symbol.සෑම සංකේතයක්ම දැනගන්න.
- Draw a full trace table column for each variable.සෑම විචල්යයකටම තීරුවක්.
- Compiler = whole program; interpreter = line by line.Compiler සහ interpreter.
- Syntax, runtime and logic errors are different.දෝෂ වර්ග තුන.
- // floor division, % remainder, ** right to left.//, %, **.
- for = iteration; while = looping.for සහ while.
- Parameters receive arguments; return sends back.පරාමිති සහ return.
- Lists change; tuples and strings do not.ලැයිස්තු වෙනස් වේ.
- w erases, a appends, r reads.w, a, r.
- commit() saves database changes.commit() සුරකියි.
- Beyond boxes (AI assistants, type hints) are interest only.Beyond කොටු විභාගයට අවශ්ය නැත.
Answers & Downloadsපිළිතුරු සහ බාගත කිරීම්
Paper I – answers with explanationsPaper I – පිළිතුරු සහ පැහැදිලි කිරීම්
| # | Answerපිළිතුර | Whyහේතුව |
|---|---|---|
| 1 | B | Top-down.Top-down. |
| 2 | C | Structure chart.ව්යුහ සටහන. |
| 3 | D | Diamond.දියමන්තිය. |
| 4 | B | Parallelogram.සමාන්තරාස්රය. |
| 5 | E | Compare each.සසඳන්න. |
| 6 | B | 1GL.1GL. |
| 7 | D | Logic.තාර්කික. |
| 8 | E | Compiler.Compiler. |
| 9 | B | Interpreter.Interpreter. |
| 10 | D | Linker.Linker. |
| 11 | C | Logic.තාර්කික. |
| 12 | E | Breakpoint.Breakpoint. |
| 13 | D | Floor division.පූර්ණ බෙදීම. |
| 14 | A | Right to left.දකුණේ සිට. |
| 15 | C | 101 XOR 011.101 XOR 011. |
| 16 | E | Float.Float. |
| 17 | A | Selection.වරණය. |
| 18 | E | 4 + 7 + 2.4 + 7 + 2. |
| 19 | A | Stop excluded.4 නැත. |
| 20 | A | 3 × 100.3 × 100. |
| 21 | B | Local.Local. |
| 22 | D | Index 4–8.4–8. |
| 23 | E | Tuple.Tuple. |
| 24 | A | Dictionary.ශබ්දකෝෂය. |
| 25 | B | Append.Append. |
| 26 | C | 78 + 45 + 88.78 + 45 + 88. |
| 27 | A | Commit.Commit. |
| 28 | D | 34, 7, 23.34, 7, 23. |
| 29 | C | 5 moves right.5 දකුණට. |
| 30 | C | 3 + 1.3 + 1. |
Paper II model answers are under each question in the “Paper II Part A” and “Part B” tabs (they open automatically when you print).Paper II ආදර්ශ පිළිතුරු “Paper II A කොටස” සහ “B කොටස” tab වල එක් එක් ප්රශ්නය යටතේ ඇත (මුද්රණය කරන විට ස්වයංක්රීයව විවෘත වේ).
Downloadsබාගත කිරීම්
Full Lesson 9 PDFසම්පූර්ණ පාඩම 9 PDF: English · සිංහල
← Back to Lesson 9පාඩම 9 වෙත ආපසු ‹ 9.13 Searching and Sorting: Sequential Search and Bubble Sortසෙවීම සහ වර්ග කිරීම: අනුක්රමික සෙවීම සහ Bubble Sort
Resource Book Lesson Note Download Questions Syllabus Sinhala LMS Simulator Tool
