GRADE 8 Module 4 Programming this is a ppt on programming
SampaRasanie
0 views
52 slides
Oct 08, 2025
Slide 1 of 52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
About This Presentation
GRADE 8 Module 4 Programming this is a ppt on programming
Size: 3.23 MB
Language: none
Added: Oct 08, 2025
Slides: 52 pages
Slide Content
Programming ක්රමලේඛ ගොඩනැගීම GRADE 8 – UNIT 4 11/19/2023 GRADE 8 - UNIT 4 1
Programming ක්රමලේඛනය Computer programming is defined as a process of developing and implementing various set of instructions given to the computer to perform a certain predefined task. පරිගණක ක්රමලේඛනය යනු කිසියම් පූර්ව නිශ්චිත කාර්යයක් ඉටු කිරීම සඳහා පරිගණකයට ලබා දී ඇති විවිධ උපදෙස් මාලාවක් සංවර්ධනය කර ක්රියාත්මක කිරීමේ ක්රියාවලියක් ලෙස අර්ථ දැක්වේ. Computer Programming is easy if it is appropriately managed. පරිගණක ක්රමලේඛනය නිසි ලෙස කළමනාකරණය කරන්නේ නම් එය පහසු වේ. There are many computer programming languages available. පරිගණක ක්රමලේඛන භාෂා බොහොමයක් තිබේ. 11/19/2023 GRADE 8 - UNIT 4 2
11/19/2023 GRADE 8 - UNIT 4 3
Programming Languages ක්රමලේඛන භාෂා Computer programming is a set of written instructions that the computer follows. පරිගණක ක්රමලේඛනය යනු පරිගණකය අනුගමනය කරන ලිඛිත උපදෙස් මාලාවකි. These instructions can be written in various languages. මෙම උපදෙස් විවිධ භාෂාවලින් ලිවිය හැකිය. Each programming languages have their unique ways of organizing the commands which are called syntax. සෑම ක්රමලේඛන භාෂාවකටම වාක්ය ඛණ්ඩ ලෙසින් හැඳින්වෙන විධානයන් සංවිධානය කිරීමේ අනන්ය ක්රමයක් ඇත. Multiple programming languages can help you solve the same programming problem. එකම ක්රමලේඛන ගැටළුව විසඳීමට බහු ක්රමලේඛන භාෂා ඔබට උපකාර කළ හැක. 11/19/2023 GRADE 8 - UNIT 4 4
Programming Languages ක්රමලේඛන භාෂා HTML and CSS Python Java JavaScript Swift C C++ C# R Golang (Go) PHP ASP.net 11/19/2023 GRADE 8 - UNIT 4 5
Algorithm ඇල්ගොරිතමය When we want to design and implement a program it is important to develop a “blueprint” of the program, which details the step-by-step procedure in arriving at the solution. Such “blueprint” is called an algorithm. අපට වැඩසටහනක් සැලසුම් කර ක්රියාත්මක කිරීමට අවශ්ය වූ විට, විසඳුම වෙත පැමිණීමේ පියවරෙන් පියවර ක්රියා පටිපාටිය විස්තර කරන වැඩසටහනේ “ blueprint ” සංවර්ධනය කිරීම වැදගත් වේ. එවැනි " blueprint " ඇල්ගොරිතමයක් ලෙස හැඳින්වේ. 11/19/2023 GRADE 8 - UNIT 4 6 This Photo by Unknown Author is licensed under CC BY-SA
Algorithm ඇල්ගොරිතමය A method that includes all the steps of solving a problem in order is known as an algorithm. ගැටලුවක් විසඳීමේ සියලු පියවරයන් පිළිවෙලට ඇතුළත් වන ක්රමයක් ඇල්ගොරිතමයක් ලෙස හැඳින්වේ. 11/19/2023 GRADE 8 - UNIT 4 7
Algorithm ඇල්ගොරිතමය An algorithm is always a step wise approach which must be written in sequential manner. ඇල්ගොරිතමයක් යනු සෑම විටම අනුක්රමික ආකාරයෙන් ලිවිය යුතු පියවර ප්රවේශයකි. Before creating the algorithm, it’s important to identify and decompose input, process and output of the problem. ඇල්ගොරිතම නිර්මාණය කිරීමට පෙර, ගැටලුවේ ආදානය, ක්රියාවලිය සහ ප්රතිදානය හඳුනා ගැනීම සහ වියෝජනය කිරීම වැදගත් වේ. 11/19/2023 GRADE 8 - UNIT 4 8
Algorithm ඇල්ගොරිතමය 11/19/2023 GRADE 8 - UNIT 4 9 Boil fresh water Warm the pot Add tea leaves/bags in the pot Pour water & rinse Pour & steep Add some extras Enjoy your tea
Algorithm ඇල්ගොරිතමය The notation used for algorithm specification must conform to a basic set of criteria: ඇල්ගොරිතම පිරිවිතර සඳහා භාවිතා කරන අංකනය මූලික නිර්ණායක සමූහයකට අනුකූල විය යුතුය: Well defined inputs හොඳින් අර්ථ දක්වා ඇති ආදාන ඇතුලත් විය යුතුය. Well defined outputs හොඳින් අර්ථ දක්වා ඇති ප්රතිදාන පැවතිය යුතුය. Finiteness පරිමිත බව Feasible සංවර්ධනය කළ හැකි විය යුතුය Concise සංක්ෂිප්ත බව Clear and unambiguous පැහැදිලි බව Machine executable යන්ත්රයක් මගින් ක්රියාත්මක කළ හැකි විය යුතුය Language Independent භාෂාව මත පදනම් නොවිය යුතුය Must promote elegance in the solution විසඳුමේ සුහුරු බව ප්රවර්ධනය කළ යුතුය 11/19/2023 GRADE 8 - UNIT 4 10
Algorithm ඇල්ගොරිතමය 11/19/2023 GRADE 8 - UNIT 4 11 Problem 1 : Add 2 numbers 1. Enter first number <-- Input data 2. Give ADD command <-- Instruction 3. Enter second number <-- Input data 4. Calculate first number+second number as total <-- Process 5. Display total <-- Output
Algorithm ඇල්ගොරිතමය 11/19/2023 GRADE 8 - UNIT 4 12 Problem 2 : Multiply 3 numbers 1. Enter first number 2. Give MULTIPLICATION command 3. Enter second number 4. Give MULTIPLICATION command 5. Enter third number 6. Calculate first number * second number * third number as product 7. Display product
11/19/2023 GRADE 8 - UNIT 4 13
Algorithm ඇල්ගොරිතමය 11/19/2023 GRADE 8 - UNIT 4 14 Problem 3 : Calculate square of a number 1. Enter number <-- Input 2. Calculate number*number as square <-- Process 3. Display square <-- Output
Control Structures පාලන ව්යුහ There are 3 control structures which can be used in an algorithm. ඇල්ගොරිතමයක් තුළ භාවිතා කළ හැකි පාලන ව්යුහයන් 3 ක් ඇත. Sequence අනුක්රමය Selection වරණය Repetition / Iteration පුනර්කරණය 11/19/2023 GRADE 8 - UNIT 4 15
Control Structures පාලන ව්යුහ Sequence – The steps are done one after the other අනුපිළිවෙල - පියවර එකින් එක සිදු කරනු ලැබේ Selection – Making a decision තේරීම - තීරණයක් ගැනීම Repetition / Iteration – Doing the same work multiple times until a condition reaches පුනර්කරණය - කොන්දේසියක් ළඟා වන තෙක් එකම කාර්යය කිහිප වතාවක් කිරීම 11/19/2023 GRADE 8 - UNIT 4 16
Algorithm ඇල්ගොරිතමය 11/19/2023 GRADE 8 - UNIT 4 17
11/19/2023 GRADE 8 - UNIT 4 18 Problem 4 : Add 4 numbers
11/19/2023 GRADE 8 - UNIT 4 19 Problem 5 : Calculate the perimeter of a rectangle
11/19/2023 GRADE 8 - UNIT 4 20 Problem 6 : Calculate the perimeter of a circle
11/19/2023 GRADE 8 - UNIT 4 21 Problem 7 : Calculate the area of a rectangle
11/19/2023 GRADE 8 - UNIT 4 22 Problem 7 : Calculate the area of a circle
11/19/2023 GRADE 8 - UNIT 4 23 Problem 8 - Convert the input speed in kmph to m/s. 72km * 1000 =20m/s 1h * 60 * 60 Km x 1000 H x 60 x 60
Algorithm – Selection ඇල්ගොරිතමය - වරණය 11/19/2023 GRADE 8 - UNIT 4 24 Draw flow charts for following functions පහත සඳහන් කාර්යයන් සඳහා ගැලීම් සටහන් අඳින්න Check whether a selected number is odd or even අංකයක් ඔත්තේ ද ඉරට්ටේ ද යන්න පරීක්ෂා කරන්න Check whether a number is a multiple of 6 අංකයක් 6 හි ගුණාකාරයක් දැයි පරීක්ෂා කරන්න Check whether the average mark of 3 subjects make the student pass (Pass mark – 40 or above) විෂයයන් 3 ක සාමාන්ය ලකුණු අනුව ශිෂ්යයා සමත් වේද යන්න පරීක්ෂා කරන්න (සාමාර්ථ ලකුණ - 40 හෝ ඊට වැඩි) Grade students as A,B,C,S & W according to the average mark of 4 subjects විෂයයන් 4 ක සාමාන්ය ලකුණු අනුව සිසුන් A,B,C,S & W ලෙස ශ්රේණිගත කරන්න
Algorithm – Selection ඇල්ගොරිතමය - වරණය 11/19/2023 GRADE 8 - UNIT 4 29 Find the Net Total payable according to following criteria Product Total >=20000 – Discount : 20% Product Total >=10000 – Discount : 10% Product Total >=5000 – Discount : 5% Less than 5000 is not offered with any discount
Algorithm – Selection ඇල්ගොරිතමය - වරණය 11/19/2023 GRADE 8 - UNIT 4 30 Try Out https://www.cimt.org.uk/projects/mepres/book8/bk8i1/bk8_1i2.htm
Algorithm – Iteration / Repetition ඇල්ගොරිතමය - පුනර්කරණය 11/19/2023 GRADE 8 - UNIT 4 31 Draw flow charts for following functions පහත සඳහන් කාර්යයන් සඳහා ගැලීම් සටහන් අඳින්න Print natural numbers from 1-10 1-10 සිට ස්වභාවික සංඛ්යා මුද්රණය කරන්න Print the times table for 8 8 හි ගුණන වගුව මුද්රණය කරන්න Print first 10 multiples of 11 11 හි පළමු ගුණාකාර 10 මුද්රණය කරන්න Print out all integers from -11 down to -20 -11 සිට -20 දක්වා සියලුම නිඛිල මුද්රණය කරන්න Find the sum of 5 numbers සංඛ්යා 5ක එකතුව සොයන්න Print the sum of first 6 even numbers පළමු ඉරට්ටේ අංක 6 හි එකතුව මුද්රණය කරන්න Find the factorial of a given number ලබා දී ඇති සංඛ්යාවක සාධකමය අගය සොයන්න (Ex: Factorial of 5=5x4x3x2x1=120)
Print natural numbers from 1-10 1-10 සිට ස්වභාවික සංඛ්යා මුද්රණය කරන්න 11/19/2023 GRADE 8 - UNIT 4 32
11/19/2023 GRADE 8 - UNIT 4 33
11/19/2023 GRADE 8 - UNIT 4 34
11/19/2023 GRADE 8 - UNIT 4 35
Print natural numbers from 1000-1 1000-1 ස්වභාවික සංඛ්යා මුද්රණය කරන්න 11/19/2023 GRADE 8 - UNIT 4 36
11/19/2023 GRADE 8 - UNIT 4 37
Print natural numbers from start to end numbers given by the user 11/19/2023 GRADE 8 - UNIT 4 38
11/19/2023 GRADE 8 - UNIT 4 39
Print the times table for 8 8 හි ගුණන වගුව මුද්රණය කරන්න 11/19/2023 GRADE 8 - UNIT 4 40
11/19/2023 GRADE 8 - UNIT 4 41
Problem 5 - Print the pattern 5,8,11,14,17,20,23,26,29,32,35,38,42,45,48,51,54,57,60 11/19/2023 GRADE 8 - UNIT 4 42
Problem 6 - Print the pattern 0, -10 , -20, ... , -190, -200 11/19/2023 GRADE 8 - UNIT 4 43
Print the times table for 17 17x1=17 17x20=340 11/19/2023 GRADE 8 - UNIT 4 44
Find the sum of 5 numbers සංඛ්යා 5ක එකතුව සොයන්න 11/19/2023 GRADE 8 - UNIT 4 45
Print the sum of first 6 even numbers පළමු ඉරට්ටේ අංක 6 හි එකතුව මුද්රණය කරන්න 11/19/2023 GRADE 8 - UNIT 4 46
Print the product of first 10 odd numbers 11/19/2023 GRADE 8 - UNIT 4 47