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

Slides:



Advertisements
Similar presentations
CS 240 Computer Programming 1
Advertisements

PROBLEM SOLVING TECHNIQUES
PSEUDOCODE & FLOW CHART
CS 240 Computer Programming 1
Fundamentals of Algorithms MCS - 2 Lecture # 4
Chapter 2- Visual Basic Schneider
Review Algorithm Analysis Problem Solving Space Complexity
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Algorithm & Flowchart.
Fundamentals of C programming
Chapter 1 Pseudocode & Flowcharts
Original Source : and Problem and Problem Solving.ppt.
An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this.
Lesson Objectives 1. Practise writing sequence of instructions 2. Write flowcharts for different mechanisms Keywords: Input sensor Motion sensor Output.
End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.
Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Chapter 2 Problem Solving On A Computer 2.1 Problem Solving Steps Solving a problem on a computer requires steps similar to those followed when solving.
Computational Thinking – Lesson 3 Lesson Objective To be able to construct an algorithm and flowchart for a given problem.
Chapter 2: General Problem Solving Concepts
Program Planning and Design. What is Program Planning and Design? Program planning and design is simply knowing what you want to do and how you want to.
Basic problem solving CSC 111.
Chapter 1 Pseudocode & Flowcharts
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Slide 1 Controlling Sequences of Events Traffic lights Event table.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
Structured Programming (4 Credits)
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
 Problem Analysis  Coding  Debugging  Testing.
CMSC 104, L041 Algorithms, Part 1 of 3 Topics Definition of an Algorithm Example: The Euclidean Algorithm Syntax versus Semantics Reading Sections 3.1.
Chapter One Problem Solving
Topic: Introduction to Computing Science and Programming + Algorithm
Algorithms, Part 1 of 3 The First step in the programming process
A451 Theory – 7 Programming 7A, B - Algorithms.
GC101 Introduction to computers and programs
Programming Languages
Chapter One Problem Solving
Algorithm & Programming
Chapter 2- Visual Basic Schneider
Introduction to Computing
CS1001 Programming Fundamentals 3(3-0) Lecture 2
PROGRAM CONTROL STRUCTURE
Pseudocode Upsorn Praphamontripong CS 1110 Introduction to Programming
Introduction To Flowcharting
Numbering System TODAY AND TOMORROW 11th Edition
Introduction to Algorithm – part 1
Algorithm Algorithm is a step-by-step procedure or formula or set of instruction for solving a problem Its written in English language or natural language.
Programming Logic n Techniques
Problem Solving and Programming CS140: Introduction to Computing 1 8/21/13.
Design and Technology Academic Year 2017/2018 Grade 7 First Semester.
Algorithms Y10 Introduction.
Chapter 1 Pseudocode & Flowcharts
Unit# 9: Computer Program Development
Program Design Introduction to Computer Programming By:
Chapter 2- Visual Basic Schneider
Chapter 1 Pseudocode & Flowcharts
Introduction to Algorithms and Programming
Chapter 2- Visual Basic Schneider
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Tutorial 2: Algorithms.
ICT Gaming Lesson 2.
Introduction to Programming
Basic Concepts of Algorithm
WJEC GCSE Computer Science
Chapter 1 Pseudocode & Flowcharts
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

Introduction to Algorithm – part one Jennifer Elmer Form 3 Computing

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

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

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.

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

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 2 nd step: Enter and password 3 rd step: Click on ‘Login in’ button.

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.

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

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;

Flow Chart of Arithmetic calculation (input and output)

Tasks Conclusion Algorithm Topic first part

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.

Introduction to Algorithm – part two Jennifer Elmer Form 3 Computing

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.

Concept Flowchart

Flow Chart of Arithmetic calculation (input and output)

Mixer Flowchart – Decisions / Repetitions

Task 1 Pseudo code of kitchen mixer

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

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. 3. Make circular designs with chocolate sauce. 4. Draw inward and outward lines with a toothpick.

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

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

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

Task 3 Develop flowchart

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.

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