FLOWCHARTS Part 1.

Slides:



Advertisements
Similar presentations
Working With Algorithm and Flowcharts
Advertisements

COMPUTER PROGRAMMING I Understand Problem Solving Tools to Design Programming Solutions.
Unit 7.6 Lesson 2 Goals Identify and use flowchart symbols. Plan a sequence of events and incorporate them into a flowchart. Create a simple flowchart.
Basics of Computer Programming Web Design Section 8-1.
Programming Fundamentals (750113) Ch1. Problem Solving
Slide 1 Controlling Sequences of Events Traffic lights Event table.
Computer Programming I Summer 2011
Algorithms and Pseudocode
Learning Objective To be able to… Understand flow chart symbols Complete and correct flow chart algorithms Create a program based on a flow chart.
Problem Solving Flowcharts. Flowcharts Introduction  Flowcharts allow us to create a visual representation of a solution to a problem DRAW  With flowcharts,
Algorithms and Flowcharts
What is accessible information? On the next slide we will show you a few examples. It is information that everyone can understand.
Scratch Programming Cards
Creating Flowcharts Principles of Engineering
Creating a Flowchart Computer Integrated Manufacturing
ALGORITHMS AND FLOWCHARTS
Understand Problem Solving Tools to Design Programming Solutions
Create a Halloween Computer Game in Scratch
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Introduction to Flowcharting
Making coffee Start or stop Process Decision Input/output Start
Basics of Computer Programming
Understanding Communication with a Robot? Activity (60 minutes)
Angles in Triangles.
Understand Problem Solving Tools to Design Programming Solutions
Teaching design techniques to design efficient solutions to problems
Introduction To Flowcharting
Introduction to Programmng in Python
Basics of Computer Programming
Diamond Hunt Mock Programming Project.
FLOWCHARTS Part 2.
Basics of Computer Programming
Instructing the computer with algorithms and flowcharts
Basics of Computer Programming
Creating Flowcharts Principles of Engineering
Yenka Portfolio Level for this topic: Student Name : My Levels
Creating Flowcharts AIM:
Learning to program with Logo
SKILLS for LEARNING SKILLS for STUDY Part 3
Print slides for students reference
Design and Technology Academic Year 2017/2018 Grade 7 First Semester.
Writing Functions( ) (Part 5)
Algorithms Today we will look at: what the word algorithm means
What is accessible information? It is information that everyone can understand. On the next slide we will show you a few examples.
Algorithms Y10 Introduction.
Creating Flowcharts Principles of Engineering
Problem-Solving and Control Structures By Faith Brenner
Tips for taking the FCAT.
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Programming Fundamentals (750113) Ch1. Problem Solving
An Introduction to VEX IQ Programming with Modkit
Theory of Computation Turing Machines.
Go to =>
What Are They? Who Needs ‘em? An Example: Scoring in Tennis
An Introduction to VEX IQ Programming with Modkit
Computers in the real world Objectives
Faculty of Computer Science & Information System
My Take on the Largest Number Algorithm
N6 Calculating with fractions
Problem-Solving and Control Structures By Faith Brenner
I know that what I say and do can affect my friends
Flowcharts and Pseudo Code
Tonga Institute of Higher Education IT 141: Information Systems
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Tonga Institute of Higher Education IT 141: Information Systems
Creating Flowcharts Principles of Engineering
Flowcharts Activity One
Creating a Simple Game in Scratch
Creating Flowcharts Principles Of Engineering
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Presentation transcript:

FLOWCHARTS Part 1

What is a flowchart? A flowchart is a way of visually representing an algorithm. An algorithm is a set of instructions or processes. Flowcharts are strict. This is because computers need SPECIFIC instructions. We decompose large problems into smaller problems to form the instructions. Each flowchart shape contains one SMALL part of the whole problem. We do not over-fill flowchart shapes with essay length instructions.

Basic shapes These flowchart shapes are internationally recognised, so we must use them and NOT invent our own ones! Terminator; This either contains START or END, and only one of each exists in a flowchart. They specify where the start and end of a flowchart is. Input/output; We use this shape to show that something is going IN or OUT of the system we are designing. For example, we put a tea bag into a cup. Process; We use this to show that something is happening. So, if I was to walk five steps forward, that is a process. It can't be an output or input as nothing is going in or out! Decision; Decisions are used when we need to make a choice. Decisions MUST have two exits, one labelled YES and one NO. They are the only shape that has two exits. For example, “Is the kettle boiled?” This is either a YES or a NO…

How to draw flowcharts www.draw.io Most office products have shapes you can use in the insert menus (see screenshot to the left). Remember you can use lines to connect the shapes together. Some good websites exist such as: www.draw.io

Example 1 - Getting a book out of a backpack. Start Open zip Remove book from bag End

Example 1 - Getting a book out of a backpack. Explained I start all flowcharts with the TERMINATOR symbol. It only ever contains the word “START”. Start Notice how the FLOW of logic is represented by arrows… the logic here is going FROM ‘Start’ TO ‘Open zip’. Open zip Opening the zip is a PROCESS, so I use the square here. Remove book from bag Removing the book is an OUTPUT from the system, so it uses the parallelogram shape. I finish all flowcharts with the TERMINATOR symbol. It only ever contains the word “END”. Remember I only have one of these in a flowchart. All routes must end up here! End

Example 2 – Determine if I have picked up a red pencil. Start Pick up a random pencil Say “The pencil is red.” Yes Is the pencil red? End No Say “The pencil is not red.”

Example 2 – Determine if I have picked up a red pencil. Explained NoticSethaorwt decision boxes have two arrows leaving. One is always YES and one is always NO. They correspond to the route that should be taken depending upon the decision. Pick up a random pencil If the pencil was red in my decision… so “YES; it was red” then I follow the YES path out of the decision and end up here! Say “The pencil is red.” Yes Is the pencil red? End No Say “The pencil is not red.” If the pencil was not red in my decision… so “NO; it was not red” then I follow the NO path out of the decision and end up here! I cannot assume what colour the pencil is, so I must start be making a decision… is it RED? YES or NO?

Example 3 – Determine if a kettle has boiled Example 3 – Determine if a kettle has boiled. If so, pour the water into a cup. Start Turn on the kettle Pour water into cup Yes Has the kettle boiled? End No

Example 3 – Determine if a kettle has boiled Example 3 – Determine if a kettle has boiled. If so, pour the water into a cup. Explained Start When the kettle has boiled, we can escape the loop because the process may now continue: “YES; the kettle has boiled”. Turn on the kettle Pour water into cup Yes Has the kettle boiled? End No If the kettle has not boiled… can we continue with our process? NO! So we must LOOP until it has boiled. Quite simply here we continuously check to see if the kettle has boiled. This loops stops us pouring cold water into a cup which is incorrect logic!

Display the LOSE screen. Example 4 – In my game, If I bump a red apple I win. If I bump a green apple I lose. Move around Start Have I bumped a red apple? Yes Display the WIN screen. No End Have I bumped a green apple? No Yes Display the LOSE screen.

Example 4 – In my game, If I bump a red apple I win Example 4 – In my game, If I bump a red apple I win. If I bump a green apple I lose. Explained move Start First lets check If I have hit a red apple… If I have then I know I win the game. If I have not… then I should check I have not hit a green one instead. Have I bumped a red apple? Yes Display the WIN screen. No Remember that all routes join back at ONE terminator symbol called “END”. End Have I bumped a green apple? No Yes So If DI hisapvleanyotthheit a red apple I might have hit a greeLnOoSnEe.sIcfrIeheanv.e, then I lose. But if not… then I already know I have not hit a red one, so I should just go back to the part where the player moves around the game… I loop around and keep checking until I have hit an apple!

Have a go… Try to solve this one on your own: Create a flowchart that will determine if a car’s headlights are on. If they are on, then do nothing. If they are off, then turn them on. Remember to use the right symbols! When you have drawn your flowchart, move to the next slide for the answer.

Create a flowchart that will determine if car’s headlights are on Create a flowchart that will determine if car’s headlights are on. If they are on, then do nothing. If they are off, then turn them on. Solution Start Are the lights on? Yes End No Turn lights on

Have a go… Try to solve this one on your own: If it is raining outside, then before I leave the house I need to put on my coat and check that I have shut the windows. If they are still open, then close them. This one is worded differently, but it still asks for you to follow the same sort of process! When you have drawn your flowchart, move to the next slide for the answer.

If it is raining outside, then before I leave the house I need to put on my coat and check that I have shut the windows. If they are still open, then close them. Solution Start Put on coat Is it raining outside? Yes Yes Are the windows closed? No No Close the windows End

Q&A Does it matter what colour the shapes are? No, however to make flowcharts more readable normally we make each of the shape types one constant colour, as you have seen in the examples. I cannot determine which shape to use. This is normally because the process you are trying to represent is too broad and needs to be broken down more. Consider if you can break your current problem down into smaller stages you can represent. I get confused about how to order things, and when to use loops. Talk the process through to someone else. This other person will not know the flowchart, so will be able to tell you if your logic flows correctly or not. If what you have said does not really make sense or is confusing, then you know to go back and have another look.

Good & Bad practice Bad Practice Good Practice Start with 0 health Start Set health to 0 Show lose screen and end game. Display the LOSE screen. End Do not put ANYTHING else inside the terminator shape… put these things in other shapes.

Good & Bad practice Bad Practice Good Practice Move forward Move forward and set health to 0, then add 1 point Set health to 0 Add 1 point Do not squash multiple instructions into one shape; always split them into separate shapes! Do this even if the same shape is to be used.

Good & Bad practice Bad Practice Good Practice Move forward Move forward Avoid badly presenting the flowchart. Make sure that you use neat, thin arrows and not huge thick ones, as this makes the logic harder to follow. Ensure that the arrows touch the two shapes they connect. Neat right angled arrows that are single pixel look professional and are easier to follow.

Good & Bad practice Bad Practice Good Practice Is the pencil red? Is the pencil red? Yes No Never leave decisions without labelling the YES and NO lines clearly! Not doing this makes the logic impossible to follow.

Good & Bad practice Bad Practice Good Practice Move forward Move forward Set health to 0 Set health to 0 Add 1 point Add 1 point Do not just put in lines… make sure the lines have arrow heads to show direction of logic flow!

Tips for BEST MARKS! Make sure that the logic flows correctly and you cannot get “stuck” anywhere! Make sure all shapes are used correctly where appropriate. Make the flowchart neat and tidy; with thin arrows that clearly connect to the start and end. Decompose down the problem so it is as specific as possible.