Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Algorithm – part 1

Similar presentations


Presentation on theme: "Introduction to Algorithm – part 1"— Presentation transcript:

1 Introduction to Algorithm – part 1
Senior 5 – Computer Studies Ms Jennifer Jennifer Elmer

2 An Algorithm is a step by step process to solve a computing problem.
Start Step 1 Step 2 Step 3 Step 4 Step… End Process What is an Algorithm? Ms Jennifer

3 A process is a series of steps (instructions) to achieve a particular goal
What is a process? Ms Jennifer

4 How can we express a an algorithm?
Think of a solution to the problem Think of the steps required to achieve the final solution. Write down the STEPS. How can we express a an algorithm? Ms Jennifer

5 Pseudo code means ’false code’ and it is essentially a summary of the algorithm written in steps using a language and specific terms. There are no set rules in using pseudo as long as all the steps of the algorithm are written sequentially and are logically correct. What is Pseudo code? Ms Jennifer

6 What is Pseudo code? Specific terms used in pseudo code include:
Arithmetic operations Transfer operations Input / output operations Decision operations Repetition operations What is Pseudo code? Ms Jennifer

7 Example question How do you log in to Facebook?
Answer? Use a laptop, tablet, computer, smart phone, etc. How do you write an algorithm to log in to Facebook? 1st step: Go to 2nd step: Enter and password 3rd step: Click on ‘Login in’ button. Example question Ms Jennifer

8 An algorithm is constructed with Pseudo Code and Flowcharts
Graphical representation of the sequence of steps of an algorithm. Step by step instructions similar to computer code. An algorithm is constructed with Pseudo Code and Flowcharts Ms Jennifer

9 Pseudo code for Arithmetic calculations
Person A has 6 subjects Person B has 3 subjects Sum = A + B Print Sum How many subjects there is in Sum? Sum = A – B Pseudo code for Arithmetic calculations Ms Jennifer

10 Pseudo code for Arithmetic calculations (input and output)
A = 0; B = 0; Give input value to A Save A Give input value to B Save B Sum = A x B Print Sum What is the value of Sum? Pseudo code for Arithmetic calculations (input and output) Ms Jennifer

11 Flow Chart of Arithmetic calculation (input and output)
Ms Jennifer

12 Tasks Conclusion Algorithm Topic first part Ms Jennifer

13 An algorithm is a step by step process to solve a computing problem.
A process is a series of steps or instructions to achieve a particular goal. An algorithm can be developed through pseudo code and flowcharts. Pseudo code defines the algorithm in a series of sequential steps/ instructions Flowcharts express the steps of an algorithm in a graphical representation. Each shape means a particular stage or step of an algorithm. Conclusion Ms Jennifer

14 Introduction to Algorithm – part 2
Senior 5 – Computer Studies Ms Jennifer

15 An algorithm is constructed with Pseudo Code and Flowcharts
Graphical representation of the sequence of steps of an algorithm. Step by step instructions similar to computer code. An algorithm is constructed with Pseudo Code and Flowcharts Ms Jennifer

16 Concept Flowchart Ms Jennifer

17 Flow Chart of Arithmetic calculation (input and output)
Ms Jennifer

18 Mixer Flowchart – Decisions / Repetitions
Ms Jennifer

19 Task 1 Pseudo code of kitchen mixer Ms Jennifer

20 Task 2 – Flowchart to log in to Facebook
Pseudo Code: 1st step: Go to 2nd step: Enter and password 3rd step: Click on ‘Login in’ button. Task 2 – Flowchart to log in to Facebook Ms Jennifer

21 Steps to make art coffee.
1. Put coffee with boiling water in the cup 2. Add steamed milk to the top of cup Steps to make art coffee. Ms Jennifer

22 Steps to make art coffee.
3. Make circular designs with chocolate sauce. 4. Draw inward and outward lines with a toothpick. Steps to make art coffee. Ms Jennifer

23 Steps to make art coffee.
End result – Web coffee art! Steps to make art coffee. Ms Jennifer

24 Pseudo Code If […] Then [….] Else [….] statements
Conditional statements Ms Jennifer

25 Pseudo Code for coffee art.
Start Program Step 1. If cup has coffee Then -> Add milk Else Add coffee Step 2. If cup has coffee + milk Then -> Add chocolate sauce in circular motion Else go to step 1 Step 3. If cup has chocolate sauce on top Then -> make horizontal lines with toothpick Else go to step 2 Step 4. End If Coffee has horizontal chocolate lines.. Else go to step 3 End program Note: the conditional statements in red Pseudo Code for coffee art. Ms Jennifer

26 Task 3 Develop flowchart Ms Jennifer Jennifer Elmer

27 An algorithm is a step by step process to solve a computing problem.
In computing an algorithm is expressed by pseudo code and flowcharts. Pseudo code consists of a sequence of steps to solve a computing problem. Flowcharts are used to show the sequence of steps in a graphical representation using different shapes to present terminals, processes, decisions and inputs and outputs. Conclusion Ms Jennifer


Download ppt "Introduction to Algorithm – part 1"

Similar presentations


Ads by Google