Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Algorithm – part one Jennifer Elmer Form 3 Computing.

Similar presentations


Presentation on theme: "Introduction to Algorithm – part one Jennifer Elmer Form 3 Computing."— Presentation transcript:

1 Introduction to Algorithm – part one Jennifer Elmer Form 3 Computing

2 What is an Algorithm? 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

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

4 How can we express a solution in English language? 1. Think of a solution to the problem 2. Think of the steps required to achieve the final solution. 3. Write down the STEPS in English language.

5 What is Pseudo code? Pseudo code is a way of expressing a computer solution algorithm similar to English language.

6 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? 1 st step: Go to www.facebook.comwww.facebook.com 2 nd step: Enter email and password 3 rd step: Click on ‘Login in’ button.

7 An algorithm is constructed with Pseudo Code and Flowcharts Pseudo CodeFlowcharts Step by step instructions similar to English language. Diagram to represent the steps defined in pseudo code.

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

9 Pseudo code for Arithmetic calculations (input and output) 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? A = 0; B = 0;

10 Flow Chart of Arithmetic calculation (input and output)

11 Tasks Conclusion Algorithm Topic first part

12 Conclusion 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 diagram form. Each shape means a particular stage or step of an algorithm.

13 Introduction to Algorithm – part two Jennifer Elmer Form 3 Computing

14 An algorithm is constructed with Pseudo Code and Flowcharts Pseudo CodeFlowcharts Step by step instructions similar to English language. Diagram to represent the steps defined in pseudo code.

15 Concept Flowchart

16 Flow Chart of Arithmetic calculation (input and output)

17 Mixer Flowchart – Decisions / Repetitions

18 Task 1 Pseudo code of kitchen mixer

19 Task 2 – Flowchart to log in to Facebook Pseudo Code: 1 st step: Go to www.facebook.comwww.facebook.com 2 nd step: Enter email and password 3 rd step: Click on ‘Login in’ button.

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

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

22 Steps to make art coffee. End result – Web coffee art!

23 Pseudo Code If […] Then [….] Else [….] statements Conditional statements

24 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

25 Task 3 Develop flowchart

26 Conclusion 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 is constructed by writing a sequence of steps to solve a computing problem. Flowcharts are used to show the sequence of steps in a diagram form using different shapes to present terminals, processes, decisions and inputs and outputs.

27 New task Why an algorithm is used How can we construct a computing solution Give two tools used to develop an algorithm


Download ppt "Introduction to Algorithm – part one Jennifer Elmer Form 3 Computing."

Similar presentations


Ads by Google