Why Flowchart - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Why Flowchart

Description:

Write a program to calculate the cost of carpet for a room. ... choose from three different carpets. The price of the given carpets are per square foot. Charge ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 18
Provided by: luci153
Category:

less

Transcript and Presenter's Notes

Title: Why Flowchart


1
Why Flowchart?
  • Lets explore the reasons we should flowchart.

2
Its a graphic representation of the algorithm
  • A flowchart shows the flow of processing from the
    beginning to the end of the solution.
  • It is the single most important step in
    organizing a solution to the problem.
  • Instructions in a flowchart symbol are generic
    rather than specific to any particular language.

3
Errors
  • Logic errors can be identified much more easily
    in a flowchart than in actual code.
  • You can test the algorithm prior to writing code.
  • After the programmer has spent hours writing code
    is no time to discover a logic problem that may
    force him to return to the very beginning of
    program design - the flowchart.

4
Terminal Symbol
  • Indicates the start and end of a function.
  • Use the word end or stop for the Main Function.
  • Use begin and the function name.
  • Use the words exit or return for all other
    functions.

Start
End
5
Processing
  • Used to indicate any kind of processing such as
    calculations, copying data, incrementing
    counters, etc.

A BC
6
Input/Output
  • Indicates input to and output from the computer
    memory.
  • Some words that are used here include READ,
    INPUT, SCAN, DISPLAY, PRINT, GET, WRITE, ACCEPT.

GET length of room in inches.
7
Decision Statement
  • Indicates a logical (TRUE or FALSE).
  • It should have only 1 entrance and only 2 exits.
  • Put the question in the box and show the
    direction of the decisions.

Install?
yes
no
8
Predefined Process
  • Represents a function and is placed in the
    calling function.
  • A function has only 1 entrance and 1 exit.
  • The name of the function should be used in the
    start terminal symbol.

Dimensions
Begin Dimensions
9
Loop Control
Initialize B
  • Represents a loop with a counter.
  • The counter starts with B (the beginning value),
    is incremented by S (the incrementing value),
    until the counter is greater than E (the ending
    value).

BBS
Is BgtE?
no
yes
10
Page Connectors
  • The circle connects sections on the same page.
  • The plate connects flowcharts from page to page.
  • Letters or numbers are written inside to connect
    to a corresponding letter or number in a
    different area.

A
B
11
The Sequence Structure
12
The Double Decision Structure
13
The Single Decision Structure
14
The Repeat-Until Structure
15
The While Structure
16
The Case Structure
17
Lets Flowchart
Write a program to calculate the cost of carpet
for a room. Get dimensions of the room from the
user. Allow the user to choose from three
different carpets. The price of the given
carpets are per square foot. Charge 8 tax. If
they want installation add 0.50 per square foot.
Display all information known for the customer
to see.
Write a Comment
User Comments (0)
About PowerShow.com