Mod 2-Flowcharting
Mod 2-Flowcharting
(MODULE 2)
“
2
OBJECTIVES
3
1
TYPES, SYMBOLS,
ADVANTAGES AND
LIMITATIONS
Flowcharting
4
ALGORITHM
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
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
14
CONTROL STRUCTURES
15
Sequence Control Structure
16
Selection Control Structure
17
Selection Control Structure
18
Repetition Control Structure
19
Repetition Control Structure
20
3
Application of Flowcharting in
Control Structures
Flowcharting
21
Sequence CS
Examples (word problem and flowchart)
22
Sequence
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 .
34
Selection
35
Selection
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
38
Repetition CS
Examples (word problem and flowchart)
39
Repetition
START
Ctr = 1
YES
NO Ctr = Ctr + 1
STOP
A
40
Repetition
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
▰ 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
45