© 2026 schoolict.net (Ruwan Mangala Suraweera)
1.1 Problem Analysis: Inputs, Process and Outputsගැටලු විශ්ලේෂණය: ආදාන, ක්රියාවලිය සහ ප්රතිදාන
G.C.E. O/L Grade 11 ICT · Lesson 1G.C.E. O/L ICT · 11 ශ්රේණිය · පාඩම 1
In this videoමේ වීඩියෝවේ
- Understand the problem before you code.කේත කිරීමට පෙර ගැටලුව තේරුම් ගන්න.
- IPO: Input → Process → Output.IPO: ආදානය → සැකසීම → ප්රතිදානය.
- Find the inputs, the process and the outputs first.මුලින් ආදාන, සැකසීම සහ ප්රතිදාන සොයන්න.
- There can be many solutions – choose the best.විසඳුම් බොහොමයක් තිබිය හැක – හොඳම එක තෝරන්න.
- Test the solution with sample data.නියැදි දත්ත සමඟ විසඳුම පරීක්ෂා කරන්න.
Notesසටහන්
Syllabus 10.1. Before we write a program, we must understand the problem. A program is a set of instructions that tells a computer what to do, step by step. In this note you will learn to find the inputs, the outputs and the process of a problem, to think of different ways to solve it, and to choose the best one. This is called problem analysis.විෂය නිර්දේශය 10.1. වැඩසටහනක් ලිවීමට පෙර ගැටලුව තේරුම් ගත යුතුය. පරිගණක වැඩසටහනක් (program) යනු පරිගණකයට කළ යුතු දේ පියවරෙන් පියවර කියන උපදෙස් කට්ටලයකි. මෙම සටහනෙන් ගැටලුවක ආදාන (inputs), ප්රතිදාන (outputs) සහ ක්රියාවලිය (process) සොයා ගැනීමට, එය විසඳීමට විවිධ ක්රම ගැන සිතීමට සහ හොඳම ක්රමය තෝරා ගැනීමට ඉගෙන ගනිමු. මෙය ගැටලු විශ්ලේෂණය ලෙස හැඳින්වේ.
1. What is programming?1. ක්රමලේඛනය යනු කුමක්ද?
A computer cannot think by itself. It only follows instructions. Writing those instructions in a language the computer understands is called programming, and the person who writes them is a programmer. A program can be small (adding two numbers) or very big (the Sri Lanka Railways e-ticket system, a bank ATM or a mobile game).පරිගණකයට තනිවම සිතිය නොහැක. එය උපදෙස් පමණක් පිළිපදී. එම උපදෙස් පරිගණකයට තේරෙන භාෂාවකින් ලිවීම ක්රමලේඛනය (programming) ලෙසත්, ඒවා ලියන්නා ක්රමලේඛකයා (programmer) ලෙසත් හැඳින්වේ. වැඩසටහනක් කුඩා විය හැක (සංඛ්යා දෙකක් එකතු කිරීම) හෝ ඉතා විශාල විය හැක (ශ්රී ලංකා දුම්රිය e-ticket පද්ධතිය, බැංකු ATM එකක් හෝ ජංගම ක්රීඩාවක්).
2. Steps of problem solving2. ගැටලු විසඳීමේ පියවර
3. Inputs, process and outputs (IPO)3. ආදාන, ක්රියාවලිය සහ ප්රතිදාන (IPO)
Input – data given to the program (typed, scanned, read from a sensor). Process – the work done on the data (calculate, compare, sort). Output – the result given back (shown on screen, printed, sent as an SMS). We often write them in an IPO table.ආදානය – වැඩසටහනට දෙන දත්ත (ටයිප් කළ, ස්කෑන් කළ, සංවේදකයකින් කියවූ). ක්රියාවලිය – දත්ත මත කරන වැඩය (ගණනය, සංසන්දනය, පිළිවෙලට සැකසීම). ප්රතිදානය – ආපසු දෙන ප්රතිඵලය (තිරයේ පෙන්වීම, මුද්රණය, SMS ලෙස යැවීම). අප ඒවා බොහෝ විට IPO වගුවක ලියමු.
| Problemගැටලුව | Inputආදානය | Processක්රියාවලිය | Outputප්රතිදානය |
|---|---|---|---|
| Shop billකඩ බිල | Price, quantityමිල, ප්රමාණය | Total = Price × QuantityTotal = මිල × ප්රමාණය | Totalමුළු මුදල |
| Average of 3 marksලකුණු 3ක සාමාන්යය | Mark1, Mark2, Mark3ලකුණු 1, 2, 3 | Add, then divide by 3එකතු කර 3න් බෙදන්න | Averageසාමාන්යය |
| Electricity bill (CEB)විදුලි බිල (CEB) | Units usedභාවිත ඒකක | Units × rate + fixed chargeඒකක × ගාස්තුව + ස්ථාවර ගාස්තුව | Amount to payගෙවිය යුතු මුදල |
| Pass or failසමත් හෝ අසමත් | Markලකුණ | Is mark ≥ 35?ලකුණ ≥ 35 ද? | “Pass” or “Fail”“Pass” හෝ “Fail” |
| Bus ticket (Colombo–Kandy)බස් ප්රවේශ පත්රය (කොළඹ–මහනුවර) | Number of passengersමගීන් ගණන | Passengers × fareමගීන් × ගාස්තුව | Total fareමුළු ගාස්තුව |
4. A worked example: the shop bill4. විසඳූ උදාහරණය: කඩ බිල
Problem: A shop sells soap at Rs. 150 each. Find the total for any number of soaps. Input: price, quantity. Process: total = price × quantity. Output: total. Below is the same solution as pseudocode, as a flowchart and as a real program. Don’t worry about the code yet – you will learn it step by step in 1.3 to 1.10.ගැටලුව: කඩයක සබන් එකක් රු. 150 කි. ඕනෑම සබන් ගණනක මුළු මුදල සොයන්න. ආදානය: මිල, ප්රමාණය. ක්රියාවලිය: total = මිල × ප්රමාණය. ප්රතිදානය: total. පහත ඇත්තේ එම විසඳුමම ව්යාජ කේතයක් ලෙස, ගැලීම් සටහනක් ලෙස සහ සැබෑ වැඩසටහනක් ලෙසයි. කේතය ගැන දැන් කරදර නොවන්න – 1.3 සිට 1.10 දක්වා එය පියවරෙන් පියවර ඉගෙන ගනිමු.
📝 Pseudocodeව්යාජ කේතය (Pseudocode)
BEGIN INPUT Price, Quantity Total = Price * Quantity DISPLAY Total END
program ShopBill; var price, qty, total: integer; begin write('Enter price (Rs.): '); readln(price); write('Enter quantity: '); readln(qty); total := price * qty; writeln('Total = Rs. ', total); end.
price = int(input("Enter price (Rs.): ")) qty = int(input("Enter quantity: ")) total = price * qty print("Total = Rs.", total)
▶ Sample runනියැදි ධාවනය · same output in Pascal and Python (typed input in yellow)Pascal සහ Python දෙකෙහිම එකම ප්රතිදානය (ටයිප් කළ ආදානය කහ පාටින්)
Enter price (Rs.): 150 Enter quantity: 5 Total = Rs. 750
5. Alternative solutions (the solution space)5. විකල්ප විසඳුම් (විසඳුම් අවකාශය)
Most problems can be solved in more than one way. All the possible ways together are called the solution space. Example: find the sum of the numbers 1 to 100. Method 1: add them one by one with a loop (100 additions). Method 2: use the formula N × (N + 1) ÷ 2 (one multiplication and one division). Both give 5050, but Method 2 is much faster.බොහෝ ගැටලු එක් ක්රමයකට වඩා විසඳිය හැක. හැකි සියලු ක්රම එකට විසඳුම් අවකාශය (solution space) ලෙස හැඳින්වේ. උදාහරණය: 1 සිට 100 දක්වා සංඛ්යාවල එකතුව සොයන්න. ක්රමය 1: ලූපයක් මගින් එකින් එක එකතු කිරීම (එකතු කිරීම් 100). ක්රමය 2: N × (N + 1) ÷ 2 සූත්රය භාවිතය (එක් ගුණ කිරීමක් සහ එක් බෙදීමක්). දෙකම 5050 දෙයි, නමුත් ක්රමය 2 බෙහෙවින් වේගවත්ය.
program SumLoop; var i, total: integer; begin total := 0; for i := 1 to 100 do total := total + i; writeln('Sum = ', total); end.
total = 0 for i in range(1, 101): total = total + i print("Sum =", total)
▶ Sample runනියැදි ධාවනය · same output in Pascal and PythonPascal සහ Python දෙකෙහිම එකම ප්රතිදානය
Sum = 5050
program SumFormula; var n, total: integer; begin n := 100; total := n * (n + 1) div 2; writeln('Sum = ', total); end.
n = 100 total = n * (n + 1) // 2 print("Sum =", total)
▶ Sample runනියැදි ධාවනය · same output in Pascal and PythonPascal සහ Python දෙකෙහිම එකම ප්රතිදානය
Sum = 5050
| Compareසසඳන්න | Method 1 (loop)ක්රමය 1 (ලූපය) | Method 2 (formula)ක්රමය 2 (සූත්රය) |
|---|---|---|
| Number of steps for N = 100N = 100 සඳහා පියවර ගණන | About 100 additionsඑකතු කිරීම් 100 පමණ | 2 operationsමෙහෙයුම් 2 |
| Easy to understand?තේරුම් ගැනීමට පහසුද? | Yesඔව් | Yes, if you know the formulaසූත්රය දන්නේ නම් ඔව් |
| Speed for N = 1 000 000N = 1 000 000 සඳහා වේගය | Slowerමන්දගාමී | Very fastඉතා වේගවත් |
| Resultප්රතිඵලය | 50505050 | 50505050 |
6. How to choose the best solution6. හොඳම විසඳුම තෝරන ආකාරය
- Correct – gives the right answer for every valid input.නිවැරදි – සෑම වලංගු ආදානයකටම නිවැරදි පිළිතුර දෙයි.
- Efficient – fewer steps, less time and memory.කාර්යක්ෂම – අඩු පියවර, අඩු කාලය සහ මතකය.
- Simple – easy to read, test and change later.සරල – කියවීමට, පරීක්ෂාවට සහ පසුව වෙනස් කිරීමට පහසු.
- Cost and resources – uses the hardware and software we have.පිරිවැය සහ සම්පත් – අප සතු දෘඩාංග සහ මෘදුකාංග භාවිත කරයි.
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1What is a program?වැඩසටහනක් යනු කුමක්ද?
2Name the three parts we find in problem analysis.ගැටලු විශ්ලේෂණයේදී සොයන කොටස් තුන නම් කරන්න.
3Give the inputs and output of a program that finds the area of a rectangle.සෘජුකෝණාස්රයක වර්ගඵලය සොයන වැඩසටහනක ආදාන සහ ප්රතිදානය දෙන්න.
4What is the solution space?විසඳුම් අවකාශය යනු කුමක්ද?
5Give two ways to find the sum of 1 to 100 and say which is better.1 සිට 100 දක්වා එකතුව සොයන ක්රම දෙකක් දී හොඳ එක කියන්න.
6List three things to check when choosing the best solution.හොඳම විසඳුම තෝරන විට පරීක්ෂා කළ යුතු කරුණු තුනක් දෙන්න.
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1A set of instructions that a computer follows is called a…පරිගණකයක් පිළිපදින උපදෙස් කට්ටලයක් හඳුන්වන්නේ…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
A program is a set of instructions.වැඩසටහන උපදෙස් කට්ටලයකි.
2In a shop bill program, the quantity bought is…කඩ බිල් වැඩසටහනක මිලදී ගත් ප්රමාණය…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
It is data given to the program.එය වැඩසටහනට දෙන දත්තයකි.
3In the same program, the total amount shown on the screen is…එම වැඩසටහනේම තිරයේ පෙන්වන මුළු මුදල…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
It is the result.එය ප්රතිඵලයයි.
4“Total = Price × Quantity” is part of the…“Total = මිල × ප්රමාණය” අයත් වන්නේ…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Calculation = process.ගණනය = ක්රියාවලිය.
5The first step of problem solving is to…ගැටලු විසඳීමේ පළමු පියවර…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Understand first.පළමුව තේරුම් ගන්න.
6For a program that finds the average of three marks, the inputs are…ලකුණු තුනක සාමාන්යය සොයන වැඩසටහනක ආදාන…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Marks are given; average is the output.ලකුණු දෙනු ලැබේ; සාමාන්යය ප්රතිදානයයි.
7All the possible ways of solving a problem are together called the…ගැටලුවක් විසඳිය හැකි සියලු ක්රම එකට හඳුන්වන්නේ…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Solution space.විසඳුම් අවකාශය.
8Using N × (N + 1) ÷ 2, the sum of 1 to 100 is…N × (N + 1) ÷ 2 භාවිතයෙන් 1 සිට 100 දක්වා එකතුව…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
100 × 101 ÷ 2 = 5050.100 × 101 ÷ 2 = 5050.
9Why is the formula method better than adding 1 to 100 one by one?1 සිට 100 දක්වා එකින් එක එකතු කිරීමට වඩා සූත්ර ක්රමය හොඳ ඇයි?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Same answer, fewer steps.එකම පිළිතුර, අඩු පියවර.
10A good solution should be…හොඳ විසඳුමක් විය යුත්තේ…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Correct, efficient, simple.නිවැරදි, කාර්යක්ෂම, සරල.
11In a CEB electricity bill program, the number of units used is…CEB විදුලි බිල් වැඩසටහනක භාවිත කළ ඒකක ගණන…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Units are read from the meter and given to the program.ඒකක මීටරයෙන් කියවා වැඩසටහනට දෙනු ලැබේ.
12Which is an output device that can show a program’s result?වැඩසටහනක ප්රතිඵලය පෙන්විය හැකි ප්රතිදාන උපාංගයක් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Monitor shows output.මොනිටරය ප්රතිදානය පෙන්වයි.
13The table that lists inputs, process and outputs is the…ආදාන, ක්රියාවලිය සහ ප්රතිදාන ලැයිස්තුගත කරන වගුව…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
IPO = Input-Process-Output.IPO = ආදාන-ක්රියාවලිය-ප්රතිදාන.
14For price 150 and quantity 5, the shop bill program shows…මිල 150 සහ ප්රමාණය 5 සඳහා කඩ බිල් වැඩසටහන පෙන්වන්නේ…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
150 × 5 = 750.150 × 5 = 750.
15You can run a Python or Pascal program without installing anything by using…කිසිවක් ස්ථාපනය නොකර Python හෝ Pascal වැඩසටහනක් ධාවනය කිරීමට භාවිත කළ හැක්කේ…
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Online compilers run code in the browser.Online compilers browser එකේ කේතය ධාවනය කරයි.
MCQ answer keyMCQ පිළිතුරු
- A – A program is a set of instructions.වැඩසටහන උපදෙස් කට්ටලයකි.
- C – It is data given to the program.එය වැඩසටහනට දෙන දත්තයකි.
- C – It is the result.එය ප්රතිඵලයයි.
- A – Calculation = process.ගණනය = ක්රියාවලිය.
- B – Understand first.පළමුව තේරුම් ගන්න.
- D – Marks are given; average is the output.ලකුණු දෙනු ලැබේ; සාමාන්යය ප්රතිදානයයි.
- C – Solution space.විසඳුම් අවකාශය.
- B – 100 × 101 ÷ 2 = 5050.100 × 101 ÷ 2 = 5050.
- A – Same answer, fewer steps.එකම පිළිතුර, අඩු පියවර.
- C – Correct, efficient, simple.නිවැරදි, කාර්යක්ෂම, සරල.
- D – Units are read from the meter and given to the program.ඒකක මීටරයෙන් කියවා වැඩසටහනට දෙනු ලැබේ.
- A – Monitor shows output.මොනිටරය ප්රතිදානය පෙන්වයි.
- B – IPO = Input-Process-Output.IPO = ආදාන-ක්රියාවලිය-ප්රතිදාන.
- D – 150 × 5 = 750.150 × 5 = 750.
- B – Online compilers run code in the browser.Online compilers browser එකේ කේතය ධාවනය කරයි.
Structured Questionsව්යුහගත ප්රශ්න
1(i) What is problem analysis? (1 mark)
(ii) Draw an IPO table for a program that finds the area of a rectangle. (3 marks)(i) ගැටලු විශ්ලේෂණය යනු කුමක්ද? (ලකුණු 1)
(ii) සෘජුකෝණාස්රයක වර්ගඵලය සොයන වැඩසටහනක් සඳහා IPO වගුවක් අඳින්න. (ලකුණු 3) (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
2A bus from Colombo to Kandy charges the same fare for every passenger. Identify the inputs, process and output of a program that finds the total fare. (3 marks)කොළඹ සිට මහනුවරට බසයක සෑම මගියෙකුටම එකම ගාස්තුවකි. මුළු ගාස්තුව සොයන වැඩසටහනක ආදාන, ක්රියාවලිය සහ ප්රතිදානය හඳුනාගන්න. (ලකුණු 3) (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3Give two different methods to find the sum of the numbers 1 to N. Which is more efficient? Why? (4 marks)1 සිට N දක්වා සංඛ්යාවල එකතුව සොයන වෙනස් ක්රම දෙකක් දෙන්න. වඩා කාර්යක්ෂම කුමක්ද? ඇයි? (ලකුණු 4) (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4List the five steps of solving a problem with a computer, in order. (5 marks)පරිගණකයකින් ගැටලුවක් විසඳීමේ පියවර පහ පිළිවෙළින් ලියන්න. (ලකුණු 5) (5 marksලකුණු 5)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5Give three things you should check when choosing the best solution from the solution space. (3 marks)විසඳුම් අවකාශයෙන් හොඳම විසඳුම තෝරන විට පරීක්ෂා කළ යුතු කරුණු තුනක් දෙන්න. (ලකුණු 3) (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- Program = set of instructions for a computer.වැඩසටහන = පරිගණකයට උපදෙස් කට්ටලයක්.
- Problem analysis comes before writing code.ගැටලු විශ්ලේෂණය කේත ලිවීමට පෙර සිදුවේ.
- Input = data in; output = result out.ආදානය = ඇතුළු වන දත්ත; ප්රතිදානය = පිටවන ප්රතිඵලය.
- Process = work that changes inputs into outputs.ක්රියාවලිය = ආදාන ප්රතිදාන කරන වැඩය.
- Use an IPO table to plan.සැලසුමට IPO වගුවක් භාවිත කරන්න.
- Solution space = all possible solutions.විසඳුම් අවකාශය = හැකි සියලු විසඳුම්.
- Best solution: correct, efficient, simple.හොඳම විසඳුම: නිවැරදි, කාර්යක්ෂම, සරල.
- Sum 1–100: loop or formula; both give 5050.1–100 එකතුව: ලූපය හෝ සූත්රය; දෙකම 5050.
