0% found this document useful (0 votes)
8 views

Midterm Lesson1

Lesson

Uploaded by

momonga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Midterm Lesson1

Lesson

Uploaded by

momonga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

What is a flowchart?

What is a flowchart?
A flowchart is a diagram that depicts a process, system or
computer algorithm. They are widely used in multiple fields to
document, study, plan, improve and communicate often complex
processes in clear, easy-to-understand diagrams.
Flowcharts, sometimes spelled as flow charts, use rectangles,
ovals, diamonds and potentially numerous other shapes to define the
type of step, along with connecting arrows to define flow and
sequence.
Flowchart symbols

Terminal/Terminator

Process

Decision
Flowchart symbols

Document

Data, or Input/Output

Stored Data
Flowchart symbols

Flow Arrow

On-page connector/reference

Off-page
connector/reference
Flowchart symbols

Preparation
When to Draw Flowchart?
Using a flowchart has a variety of benefits:
● It helps to clarify complex processes.
● It identifies steps that do not add value to the internal or external customer,
including delays; needless storage and transportation; unnecessary work,
duplication, and added expense; breakdowns in communication.
● It helps team members gain a shared understanding of the process and use
this knowledge to collect data, identify problems, focus discussions, and
identify resources.
● It serves as a basis for designing new processes.
Guidelines for Preparing Flowchart

● Standard symbols should be used while drawing flowchart.


● Ensure that flowchart has START (or BEGIN) and STOP (or END).
● Flowchart should be neat, clean and easy to follow. There should be no any ambiguity.
● The usual direction of flowchart is from top to bottom or from left to right.
● The terminal symbol, that is, START/BEGIN or STOP/END should have only one flow line.
● Only one flow line should come out from process symbol.
● Only one flow line should enter a decision symbol, but two or three flow-lines, one for each
possible answer, can leave the decision symbol.
● If the flowchart is lengthy and complex connector symbol should be used to reduce the
number of flow lines.
● Avoid intersection of flow lines.
● Use annotation symbol to describe steps more clearly.
Rules For Creating Flowchart :
A flowchart is a graphical representation of an algorithm.it
should follow some rules while creating a flowchart
Rule 1: Flowchart opening statement must be ‘start’ keyword.
Rule 2: Flowchart ending statement must be ‘end’ keyword.
Rule 3: All symbols in the flowchart must be connected with
an arrow line.
Rule 4: The decision symbol in the flowchart is associated
with the arrow line.
Advantages of Flowchart:
● Flowcharts are a better way of communicating the logic of the
system.
● Flowcharts act as a guide for blueprint during program designed.
● Flowcharts help in debugging process.
● With the help of flowcharts programs can be easily analyzed.
● It provides better documentation.
● Flowcharts serve as a good proper documentation.
● Easy to trace errors in the software.
● Easy to understand.
● The flowchart can be reused for inconvenience in the future.
● It helps to provide correct logic.
Disadvantages of Flowchart:
● It is difficult to draw flowcharts for large and complex
programs.
● There is no standard to determine the amount of detail.
● Difficult to reproduce the flowcharts.
● It is very difficult to modify the Flowchart.
● Making a flowchart is costly.
● Some developer thinks that it is waste of time.
● It makes software processes low.
● If changes are done in software, then the flowchart must be
redrawn
Types of Flowchart
Flowcharts are visual representations of
processes or algorithms and can include
various control structures to represent
sequence, selection (conditional statements),
and repetition (iteration) in a structured way.
Sequence Control Structure:
● In a flowchart, sequence is represented by a series of
steps or actions executed in a linear order, from top to
bottom.

● Each step is connected to the next step by an arrow


pointing downward, indicating the flow of the process.

● It shows the natural progression of the process without


any branching or decision-making.
Sequence:
Flowchart example for calculating simple interest is shown below:

Example of Pseudocode
Step 1: START
Step 2: READ P, T, R
Step 3: I = P*T*R/100
Step 4: PRINT I
Step 5: STOP
Create a flowchart design that calculates the area of a rectangle:
Start ↓ Enter the length of the In this flowchart:
rectangle (L) ↓ Enter the width of
the rectangle (W) ↓ Calculate the
area: A = L * W ↓ Display the area ● "Start" and "End" represent the beginning and end of the process.
(A) ↓ End ● "Enter the length of the rectangle (L)" and "Enter the width of the rectangle (W)"
are actions that involve user input.
● "Calculate the area: A = L * W" represents the computation of the area of the
rectangle.
● "Display the area (A)" is the action of showing the calculated area to the user.
● The arrows connecting each step indicate the sequence in which these actions
occur.

To calculate the area of the rectangle, you multiply the length (L) by the width (W). The

result is then displayed to the user.

This flowchart follows a linear sequence without any decision points or branching,

making it a sequence control structure. The answer is the calculated area of the

rectangle based on the user's input.


Decision Control Structure
● Selection in a flowchart is represented using
diamond-shaped decision symbols.

● The process flow branches based on a condition or


decision.

● Typically, a condition is evaluated, and depending on


whether it's true or false, the flow follows different paths.
Decision Control Structure
Create a flowchart design that determines if a
number is even or odd:
In this flowchart:
Start
↓ ● "Start" and "End" represent the beginning and end of the process.
Enter a number (N) ● "Enter a number (N)" is an action that involves user input.
↓ ● "Is N even?" is a decision point that checks whether the number N is even
Is N even? (N % 2 == 0) or odd. It does this by calculating the remainder of N divided by 2 (N % 2
↓ == 0).
│ ● If the condition is true (i.e., N is even), it displays "N is even." If the
├─ Yes ─> Display "N is even" condition is false (N is odd), it displays "N is odd."

├─ No ─> Display "N is odd" This flowchart demonstrates a decision control structure where the flow of the
│ program is determined by the result of the condition (whether the number is even
↓ or odd). The answer is either "N is even" or "N is odd," based on the user's input.
End
Create a flowchart that determines
whether a person is eligible to vote
based on their age:
Repetition (Iteration)Control Structure
● Repetition or iteration in a flowchart is represented by loop
symbols.

● It indicates that a series of actions are repeated as long as


a specific condition is met.

● The loop is connected to a decision symbol, which is


evaluated at the beginning of each iteration.
Repetition (Iteration)Control Structure
simple problem that calculates the sum of a series of
numbers until the user decides to stop:
In this flowchart:

● "Start" and "End" represent the beginning and end of the process.
● "Initialize sum (Sum = 0)" sets the initial value of Sum to 0.
● The loop, which includes steps to enter a number, add it to the Sum, display
the current sum, and ask if the user wants to add another number.
● If the user selects "Yes," the loop continues, and the process repeats.
● If the user selects "No," the loop exits, and the program ends.

This flowchart demonstrates a repetition control structure with a loop that


continues until the user decides not to add any more numbers. The answer is the
final sum of all the numbers entered by the user.

You might also like