PROBLEM SOLVING Developing a Program Flow Charts - PowerPoint PPT Presentation

Loading...

PPT – PROBLEM SOLVING Developing a Program Flow Charts PowerPoint presentation | free to download - id: 672508-NDdlZ



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

PROBLEM SOLVING Developing a Program Flow Charts

Description:

PROBLEM SOLVING Developing a Program Flow Charts TEE/TIK 20 Writing a program Defining the problem Write down what the program will do Planning Write down the steps ... – PowerPoint PPT presentation

Number of Views:3
Avg rating:3.0/5.0
Slides: 22
Provided by: Beth135
Learn more at: http://schools.tdsb.on.ca
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: PROBLEM SOLVING Developing a Program Flow Charts


1
PROBLEM SOLVINGDeveloping a ProgramFlow Charts
  • TEE/TIK 20

2
Writing a program
  • Defining the problem
  • Write down what the program will do
  • Planning
  • Write down the steps, draw a flowchart
  • Programming
  • Coding, including errors correction, testing
  • Documenting
  • Adding comments
  • Implementing
  • Improvement, making the program better

3
Objective
  • A program can be divided into 3 parts
  • Input data
  • Processing data Calculation, etc.
  • Output information/results

Calculation/ Processing
Input
Output
4
Planning - Flowchart
  • A Diagram that uses special symbols showing the
    steps of a program

5
What is a flowchart?
  • A diagram made up of symbols of various shapes
    connected by arrows.
  • Those symbols indicate either actions to be taken
    or decisions to be made.
  • It may be used to describe any complicated
    process when a mixture of actions decisions
    take place
  • It helps us planning programming.

6
Flowchart Symbols
Decision symbol (Selection, Conditional Statement)
Terminal symbol (Start Stop)
Page connector (used when run out of room at the
bottom)
Processing symbol (Calculate, Assign, Initialize,
Declare)
Step connector (go from one part to another)
Input/Output symbol (get, put)
7
Terminal Symbol
  • Only one start one stop
  • 1 arrow only
  • Each flowchart starts with one start ends
    with one stop

start
stop
8
Input / Output Symbol
  • 2 arrows only
  • 1 in 1 out
  • Input Data
  • get fullname
  • Display result
  • put fullname

9
Processing Symbol
  • 2 arrows only
  • 1 in 1 out
  • Declaration
  • var sum real
  • Initialization
  • sum 30.14
  • Calculation

10
Decision Symbol
  • 3 arrows
  • 1 in 2 out
  • Question
  • worded this way that the answer is Yes or No
  • 2 out going arrows
  • T (True, Yes)
  • F (False, No)

Q. ?
T
F
11
Page connector
  • 1 arrow only
  • Shows the next page
  • Shows the previous page
  • Run out of space

12
Step connector
  • 1 arrow only
  • Appear in
  • 1 to 1
  • Many to 1
  • Use letters
  • Go from one step to another

A
A
13
Arrows
  • From Top to Bottom from Left to Right
  • Make turn
  • Join together

14
Example
start
1.is it the door bell? 2.start 3.answer the
phone 4.turn off the alarm 5.is it the
telephone? 6.listen to bell ringing 7.stop 8.see
who is at the door
bell ringing
turn off the alarm
N
N
phone?
door?
Y
Y
see who is at the door
answer the phone
stop
15
Example (Turing)comment
start
Define PI
  • the symbol 3 cub
  • const PI 3.14
  • var radius, volume real
  • put please enter.....
  • get radius
  • volume (4/3)PIradius3
  • put
  • put The volume is, volume

Declare radius, volume
ask radius
input radius
Calculate volume
output volume
stop
16
Example
1.start declare variables 2.what is the
mark 3.ask for mark 4.check markgt50 5.gt50 show
U Pass 6.lt50 show U Fail 7.stop
get
U Pass
gt50
U Fail
17
Example with Trace Table
Trace Table
start
x y sum







Declare Initialise x y to1
1
1
2
2
3
1
A
is sumlt20
Y
x y y sum
sum of xy
2
3
5
3
5
8
N
A
Show x,y and sum
5
8
13
8
13
21
stop
18
Programming
  • Convert the steps to instructions / programming
    languages
  • Debug correct the errors
  • Syntax errors
  • Grammar mistakes which are easily found out
  • Logical errors
  • Programs run work but the outcome is not
    correct / expected
  • Can be found by testing

19
Documentation
  • Add comments
  • Easier to understand
  • Use spaces wisely
  • Blanks, Tabs, New Lines
  • Easy to trace, follow understand
  • Choose variables constants names
  • Easy to understand, not too long or short

20
Implementation
  • Ask others to run your program
  • Make it more user friendly including input
    output
  • Make it more efficient (fewer lines)
  • Make it run faster
  • Add ending screen etc.

21
Good Luck!
About PowerShow.com