IGCSE 1 Cambridge Algorithms and flowcharts Unit 7 Computer Science

Slides:



Advertisements
Similar presentations
Introduction to Flowcharting
Advertisements

Introduction to Flowcharting
Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Published by Addison-Wesley.
Java Planning our Programs Flowcharts Arithmetic Operators.
Introduction to Computing Dr. Nadeem A Khan. Lecture 4.
Flowcharts Remember that a solution to a problem is called an algorithm. Algorithms are often a series of steps required to solve the problem. A flowchart.
Review Algorithm Analysis Problem Solving Space Complexity
Do it now activity Last lesson we learnt about instructions are run in a computer. Write a set of instructions that a computer could follow to make a cup.
Algorithm & Flowchart.
Introduction to Algorithm – part one Jennifer Elmer Form 3 Computing.
ALGORITHMS AND FLOWCHARTS
1. Know the different types of flow block 2. Understand how problems can be broken down into smaller problems.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.
Input, Output, and Processing
CSE 102 Introduction to Computer Engineering What is an Algorithm?
Flowcharts.
Computational Thinking – Lesson 3 Lesson Objective To be able to construct an algorithm and flowchart for a given problem.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Basic Control Structures
Program Development C# Programming January 30, 2007 Professor J. Sciame.
1 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm.
(C)opyright 2000 Scott/Jones Publishers Introduction to Flowcharting.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Lesson Objective: Understand how to make and use Algorithms Learning Outcome: Design your own algorithms and flowcharts. Algorithms and Flowcharts.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
Programming revision Revision tip: Focus on the things you find difficult first.
7 - Programming 7J, K, L, M, N, O – Handling Data.
Programming – Algorithms (Flowcharts)
Algorithm & Flowchart.
ALGORITHMS AND FLOWCHARTS
Topics Designing a Program Input, Processing, and Output
Introduction to Flowcharting
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
IGCSE 6 Cambridge Effectiveness of algorithms Computer Science
Computer Programming Flowchart.
Think What will be the output?
Introduction to Flowcharting
Flowcharting: Decision Structure
Chapter 5: Control Structure
Numbering System TODAY AND TOMORROW 11th Edition
Assignment statement and Arithmetic operation 2
Introduction to Flowcharting
ALGORITHMS AND FLOWCHARTS
Print slides for students reference
Software Programming J. Holvikivi 2014.
Control Structure Senior Lecturer
Algorithms Y10 Introduction.
Chapter 4: Algorithm Design
How to develop a program?
Unary Operators ++ and --
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
MSIS 655 Advanced Business Applications Programming
ALGORITHMS AND FLOWCHARTS
Chapter 2- Visual Basic Schneider
Introduction to Algorithms and Programming
Chapter 4: Algorithm Design
Introduction to Algorithms - 1
No Yes START Do you live in Scotland? Take umbrella See last Flowchart
PYTHON: BUILDING BLOCKS Sequencing & Selection
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Functions and Tables.
Introduction to Flowcharting
Introduction to Algorithms - 2
Computational Thinking (How to think like a computer scientist)
COMPUTING.
Introduction to Algorithms - 2
Presentation transcript:

IGCSE 1 Cambridge Algorithms and flowcharts Unit 7 Computer Science Section 2 Algorithms and flowcharts Unit 7 Algorithm design and problem-solving 1

Objectives Define what is meant by an “algorithm” Use standard flowchart symbols Use standard arithmetic operators Use totalling and counting

What is an algorithm? We use “algorithms” every day without even being aware of it Have you ever Made a cup of tea? Followed directions to a destination? Taken part in a school play?

An algorithm for a computer Imagine programming a robot to do any of these things… What could possibly go wrong?

Writing algorithms Start An algorithm is a series of steps to solve a problem or carry out a task A flowchart is a common “tool” used to help plan and write down the steps needed How many different flowchart symbols are you familiar with? Start

Drawing a flowchart An algorithm is a series of steps to solve a problem or carry out a task What algorithm does this flowchart represent? Start End Ask new user to input their chosen ID Output “Choose another ID” Is this ID already in use? Input ID Store ID Yes No

Calculation/ Assignment Flowchart symbols Start End Decision Is Count = 10? Yes No Calculation/ Assignment Input/Output Count = 1 Input Grade Output Total Total = Total + A

Arithmetic operators The following operators are used for calculations: Addition + Subtraction - Multiplication * Division / Exponentiation ** e.g. 2**3 = 8 Integer division div e.g. 17 div 3 = 5 Remainder mod e.g. 17 mod 3 = 2 Calculate: cost = ((5 * 7) + 3) / 4 x = ((3**2) * 4+ 7)) div 4

Counting and totalling The statement count = count + 1 means “Add 1 to the variable, called count” Output total total = 0 count = 0 count = count + 1 total = total + count No Is count = 1000?

Worksheet 1 Complete Task 1, Questions 1 and 2 on the worksheet Complete Tasks 2 and 3 on the worksheet

Program structures All programs are composed of three basic structures: Sequence Selection Iteration (repetition) Look at Tasks 2 and 3 in the worksheet and find examples of all these three structures In the next two lesson we will look in more detail at selection and iteration

Worksheet 1 Complete Task 4 on the worksheet

Plenary As well as using sequence, selection and iteration in algorithms, in Task 4 you used an inbuilt function What was the name of the function? What did it do? How did it do it? Do you need to know? You will be using many different inbuilt functions in your programs to perform useful tasks, without having to worry how the function works