

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































An algorithm is a precise step-by-step set of instructions for solving a problem or carrying out a task
They are often used to improve efficiency by removing the need for human input A computer following an algorithm can decide what decision to make far more quickly than a human Book
There are four methods of writing algorithms
All algorithms can be represented in each of these methods The four types are..
Written Description
Step by step instructions written in plain English
Book
Pseudocode
Uses structured English and keywords with a heavy focus on the order of the instructions (the logic)
Book Half way between plain English and a programming language
Program Code
Code that is produced using a programming language such as Python
Book
Algorithms can be displayed as flowcharts
Terminal Shows the start and end of an algorithm Decision/Selection Shows yes/no or true/false decisions where there are two possible outcomes Process Shows data processing , such as a calculation Input / Output Indicates an input or output Subroutine Shows a function or procedure that has its own flowchart Line Represents control passing between the other symbols Book
Example Flowcharts (Easy)
Start Terminal Output Print “Hello world” End Terminal Start Terminal Print “Mr” Output End Terminal Print “Lyon” (^) Output Change this to your name! Book
Example Flowchart (Difficult 1)
Start Is mark1 > mark2? NO YES Input mark1, mark2, mark End End End End Output mark Is mark2 > mark3? Is mark1 > mark3? NO NO YES Output mark Output mark YES Output mark Terminal Terminal Input Output DO NOT DRAW THIS FLOWCHART IT IS ON THE SHEET Output (^) Output Decision Terminal Output Terminal Terminal Decision Decision Sheet
Start End Boil kettle Add tea bag Add hot water Add milk Has the water boiled? No Yes Start End Boil kettle Add tea bag Add hot water Add milk Making a Cup of Tea Take sugar? No Yes Add Sugar
Why do we need to use flowcharts?
Plenary Task Answer the following questions
Home work- due Tuesday 27th Create a flow chart for one of the following. Remember to include as many steps as possible