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

Mod 2-Flowcharting

The document discusses flowcharting including its objectives, types, symbols, advantages, limitations, and examples of applying flowcharting to sequence, selection, and repetition control structures. It provides examples of word problems and their corresponding flowcharts to illustrate each control structure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Mod 2-Flowcharting

The document discusses flowcharting including its objectives, types, symbols, advantages, limitations, and examples of applying flowcharting to sequence, selection, and repetition control structures. It provides examples of word problems and their corresponding flowcharts to illustrate each control structure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

FLOWCHARTING

(MODULE 2)

2
OBJECTIVES

▰ Determine the types, advantages and disadvantages of


flowchart
▰ Use flowchart symbols and pseudocode statements
▰ Explain the sequence, selection, and repetition structures
▰ Write simple algorithms using the sequence, selection, and
repetition structures

3
1
TYPES, SYMBOLS,
ADVANTAGES AND
LIMITATIONS
Flowcharting
4
ALGORITHM

▰ Flowchart: pictorial representation of the logic


▰ Pseudocode: English-like representation of the logic
▻ Example:
start
get inputNumber
compute calculatedAnswer as
inputNumber times 2
print calculatedAnswer
stop 5
FLOWCHARTING

▰ A flowchart is a diagrammatic representation that illustrates the sequence of


operations to be performed to get the solution of a problem.
▰ Flowcharts are generally drawn in the early stages of formulating computer
solutions.
▰ Flowcharts facilitate communication between programmers and business
people.
▰ These flowcharts play a vital role in the programming of a problem and are
quite helpful in understanding the logic of complicated and lengthy problems.

6
FLOWCHARTING

▰ Once the flowchart is drawn, it becomes easy to write the program in any
high level language.
▰ Often we see how flowcharts are helpful in explaining the program to
others. Hence, it is correct to say that a flowchart is a must for the better
documentation of a complex program.

7
Types of Flowchart

1. Document Flowchart – illustrate the flow of documents and information between


areas of responsibility – tracks documents from beginning to end.
2. System Flowchart – depict the relationship among the input, processing, and output
of an information system.
3. Program Flowchart – illustrate the sequence of logical operations performed by a
computer in executing a program. It is a diagram that uses symbols and
interconnecting lines to show the logic and sequence of specific programming
operation.
4. Computer Configuration Flowchart – depict the arrangement of hardware
components in a computer system.
8
Flowcharting Symbols

The flowchart is a means of


visually presenting the flow
of data through an
information processing
systems, the operations
performed within the system
and the sequence in which
they are performed.

9
Advantages of Flowchart

▰ Communication. Flowcharts are better way of communicating the logic of a system to all
concerned.
▰ Effective Analysis. With the help of flowchart, problem can be analyzed in more effective way.
▰ Proper Documentation. Program flowcharts serve as a good program documentation, which
is needed for various purposes.
▰ Efficient Coding. The flowcharts act as a guide or blueprint during the systems analysis and
program development phase.
▰ Proper Debugging. The flowchart helps in debugging process.
▰ Efficient Program Maintenance. The maintenance of operating program becomes easy with
the help of flowchart. It helps the programmer to put efforts more efficiently on that part.

10
Limitations of Flowchart

▰ Complex Logic. Sometimes, the program logic is quite complicated. In that case, flowchart
becomes complex and clumsy.
▰ Alterations and Modifications. If alterations are required the flowchart may require re-drawing
completely.
▰ Reproduction. As the flowchart symbols cannot be typed, reproduction of flowchart becomes
a problem.
▰ The essentials of what is done can easily be lost in the technical details of how it is done.

11
Example of Flowchart and Pseudocode

12
2
Flowcharting in Control
Structures
Flowcharting
13
CONTROL STRUCTURE

A control structure is a series of instructions that control the


logical order in which the program instructions are executed.

14
CONTROL STRUCTURES

Sequence Selection Repetition

15
Sequence Control Structure

▰ Follow a set of directions,


in order, from beginning to
end.
▰ Used to show a single
action or one action
followed by another.

16
Selection Control Structure

▰ called DECISION Structure


▰ It indicates that a decision (based on some
condition) needs to be made, followed by an
appropriate action derived from that decision
▰ Used to tell the program which action to take based
on a certain condition.

17
Selection Control Structure

18
Repetition Control Structure

▰ (referred to as loop or as iterations) directs the


computer to repeat one or more instructions until
some condition is met, at which time the computer
should stop repeating the instructions.
▰ Used when a set of actions is to be performed
repeatedly.

19
Repetition Control Structure

20
3
Application of Flowcharting in
Control Structures
Flowcharting
21
Sequence CS
Examples (word problem and flowchart)

22
Sequence

1. Create a flowchart that will display your name 3 times.

23
Sequence

2. Create a flowchart that will ask the user to enter his/her name and display a greeting “hello” followed
by the entered name.

24
Sequence

3. Create a flowchart that will input two numbers and display the sum.

25
Sequence

4. Create a flowchart that will input Fahrenheit and display equivalent value in Celsius.

26
Sequence

5. Create a flowchart that will input customer’s money and his bill and compute and display the
customer’s change.

27
Sequence

6. Create a flowchart that will input four (4) integers then compute and display the average.

28
Sequence

29
An Introduction to Programming with C++, Sixth Edition
Selection CS
Examples (word problem and flowchart)

30
Selection

1. Create a flowchart that will input grade and determine if the student is passed or failed. Assume 75
and above is the passing mark.
.

31
Selection

2. Create a flowchart that will input the gross salary and display the net salary. Assume 10% tax will be
deducted if the gross salary is greater than 10,000, else 5%.
.

32
Selection

3. Create a flowchart that will input the gross salary and display the net salary. Assume 10% tax will be
deducted if the gross salary is greater than 10,000, else 5%.
.

33
Selection

4. Create a flowchart that will input the year level of a student and display the equivalent year description .

Year Level Year Description


1 Freshmen
2 Sophomore
3 Junior
4 Senior

34
Selection

4. Create a flowchart that


will input the year level of a
student and display the
equivalent year description
.

35
Selection

4. Create a flowchart that


will input the year level of a
student and display the
equivalent year description
.

36
Selection

5. Create a flowchart that will input 2 numbers and an operator. Compute and performed the chosen
operation. Display the computed result.

Operator Operation
* Multiplication
/ Division
+ Addition
- Subtraction

37
Selection

5. Create a flowchart that


will input 2 numbers and an
operator. Compute and
performed the chosen
operation. Display the
computed result. .

38
Repetition CS
Examples (word problem and flowchart)

39
Repetition

1. Create a flowchart that will display your name 3 times.

START

Ctr = 1

YES

Ctr <= 3 Output(“Juan Dela


A
Cruz)

NO Ctr = Ctr + 1

STOP
A

40
Repetition

2. Create a program that will display 1 to 10 using looping control structure.

41
Repetition

3. Create a flowchart that will compute for the Simple Interest 5 times.
Assume: Interest = Principal Value * Rate * Time

42
REFERENCES

Books:

▰ Farrell, J. (2018). Programming Logic and Design, Comprehensive, 9 Ed. Cengage Learning.
th

▰ Farrell, J. (2015). Java Programming, 8 Ed. Cengage Learning.


th

▰ Malik, D.S. (2012). Java Programming: From Problem Analysis to Program Design. Course Technology, Cengage Learning.
▰ Zak, D. (2016). An Introduction to Programming with C++, Sixth Edition. Cengage Learning.

43
THANKS!
Any questions?

44
CREDITS

Special thanks to all the people who made and


released these awesome resources for free:
▰ Presentation template by SlidesCarnival
▰ Photographs by Startup Stock Photos

45

You might also like