Download presentation
Presentation is loading. Please wait.
Published byAlan Parsons Modified over 7 years ago
1
Learning outcomes 5 Developing Code – Using Flowcharts
You must be able to: use a systematic approach to problem solving and algorithm creation representing those algorithms using flowcharts explain simple algorithms in terms of their inputs, processing and outputs determine the purpose of simple algorithms obtain user input from the keyboard output data and information from a program to the computer display. © Steve Cushing 2016
2
Use a systematic approach to problem solving and algorithm
5 Developing Code – Using Flowcharts Use a systematic approach to problem solving and algorithm creation representing algorithms using flowcharts In previous lessons we have explored data types and structures. This section looks at flowcharts, but to help to reinforce your learning we will also explore the same structures in pseudo-code and a high level programming language in our examples. © Steve Cushing 2016
3
5 Developing Code – Using Flowcharts
© Steve Cushing 2016
4
5 Developing Code – Using Flowcharts
© Steve Cushing 2016
5
5 Developing Code – Using Flowcharts
© Steve Cushing 2016
6
Flowcharts 5 Developing Code – Using Flowcharts
Some programmers prefer drawing flowcharts to represent the logic flow; because flowcharts allow programmers to visualise more easily how the program statements will connect. A flowchart is a visual representation of the sequence of instructions. It shows what comes first, second, third and so on. Flowcharts are a good way to show and help us with: analysis decomposition and abstraction designing the structures and constructs of our code documenting our solutions managing a process or program. © Steve Cushing 2016
7
Flowchart disadvantages
5 Developing Code – Using Flowcharts Flowchart advantages Flowcharts are a graphical way of writing an algorithm. They are standardised, so they all agree on the symbols and their meaning. They are very visual. Flowchart disadvantages They are hard to modify and can be time-consuming. They need special software for symbols, although some software has these built in. © Steve Cushing 2016
8
5 Developing Code – Using Flowcharts
When you create a flowchart, you draw geometric shapes that contain the individual statements and that are connected by a flow line. Flow lines signify that there is a flow that passes from one action to an action the arrow points to. © Steve Cushing 2016
9
5 Developing Code – Using Flowcharts
© Steve Cushing 2016
10
5 Developing Code – Using Flowcharts
Flow-lines enter the top of the symbol and exit out of the bottom, except for the Decision symbol, which can have flow lines exiting from the bottom or the sides. In flowcharts the START symbol represents the start of a process. The PROCESS symbol is labelled with a brief description of the process carried out by the flowchart. The END symbol represents the end of a process. It contains either END or RETURN depending on its function in the overall process of the flowchart. © Steve Cushing 2016
11
Flowcharts help us to follow a logical structure
5 Developing Code – Using Flowcharts Flowcharts help us to follow a logical structure Sequential processing These instructions do the actual data processing in sequence order, such as input, add/multiply/subtract, copy and output. Decision making The decision making within the program is the process of comparing or the evaluation of data and making a decision in the program based on the results. Iteration Many routines must be repeated a number of times and are accomplished with the help of loops until the desired result is achieved. © Steve Cushing 2016
12
5 Developing Code – Using Flowcharts
One of the most confusing things in a flowchart is telling the loops apart from the selections. This is because both use the diamond shape as their control symbol. Whenever possible, flowcharts should read from top to bottom on a page. In the next few slides we will explore some of the programming structures you have covered in an earlier lesson. © Steve Cushing 2016
13
5 Developing Code – Using Flowcharts
Pseudo-code Python 3 x ← USERINPUT x = input() © Steve Cushing 2016
14
5 Developing Code – Using Flowcharts
Pseudo-code Python 3 OUTPUT x print(x) © Steve Cushing 2016
15
5 Developing Code – Using Flowcharts
Pseudo-code Python 3 IF x < 5 THEN OUTPUT 'Yes' ENDIF if x < 5: print("Yes") © Steve Cushing 2016
16
5 Developing Code – Using Flowcharts
Pseudo-code Python 3 IF x < 5 THEN OUTPUT 'Yes' ELSE OUTPUT ‘No‘ ENDIF if x < 5: print("Yes") else: print(“No") © Steve Cushing 2016
17
5 Developing Code – Using Flowcharts
Pseudo-code Python 3 WHILE x < 5 do_procedure() ENDWHILE while x < 5: © Steve Cushing 2016
18
5 Developing Code – Using Flowcharts
Pseudo-code Python 3 REPEAT do_procedure() UNTIL x < 5 while True: if x < 5: break © Steve Cushing 2016
19
5 Developing Code – Using Flowcharts
Pseudo-code Python 3 FOR count ← 1 TO 4 do_procedure() ENDFOR for count in range (1,5): © Steve Cushing 2016
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.