SlideShare a Scribd company logo
1
Chapter 12
FLOWCHARTS
2
Problem Solving
Can be solved in a series of actions
Problem solving steps:
1. Identify the problem
2. Understand the problem
3. Identify alternatives (solutions)
4. Select the best solution4. Select the best solution
5. Prepare a list of steps (instruction)
6. Evaluate the solution
3
SOLUTIONS
Algorithmic Heuristic
the best alternative
solution reached by
completing actions in
steps – algorithm
cannot be reached through
direct set of steps
– require reasoning built on
knowledge & experience
– a process of trial & error
4
Problem Solving with Computers
Solution
instructions listed during
step 5 of problem solving
– must be followed to
produce best results
Result
The outcome
or completed
computer-assisted
answer
Program
Computers deal with algorithmic solutions & heuristic
solutions (artificial intelligence)
Program
set of instructions that
make up the solution
after they have been
coded into a particular
computer language
5
Constants & Variables
Constant
An alphabetical and/or
numerical value that
never changes during the
processing of all the
instructions in a solution
Variable
(identifiers) May
change during
processing
Given a name & a location
in memory
- Referred to by given name
6
Drawing the Flowcharts
Connect blocks by exiting from one
and entering another
The arrowhead is necessary
FLOWLINESFLOWLINES
Indicate the start & end of a
program
StartStart has one flowline exiting
ExitExit has one flowline entering
StartStart
ExitExit
7
Drawing the Flowcharts (cont.)
For calculations,…
Has one flowline entering and one
exiting
PROCESSINGPROCESSING
Indicates input to and output from
the computer memory
Has one entrance & one exit
I/OI/O
8
Drawing the Flowcharts (cont.)
Indicates a decision
Has one entrance & two exits
One exit is the action when the
resultant is TRUE & other exit is the
action when the resultant is FALSEDecisionDecision
i < 10
T F
Display “i is
less than 10”
ExitExit
9
Problem Solving with Computers
Problem: Display Area of a Circle
Steps to solve the problem:
1. Declare & Initialize PI value
2. Declare & Initialize Radius value
3. Declare & Initialize Area value
4. Calculate Area
5. Display the value of Area
10
Drawing the Flowchart & Writing Algorithm
Display Area of a Circle
Start
Declare & initialize
PI, Radius and Area
Algorithm
1. Constant PI = 3.142
2. Variable Radius = 10
Exit
Calculate Area
Display Area
2. Variable Radius = 10
3. Variable Area = 0.0
4. Area = PI x Radius x Radius
5. Display Area
11
Writing the Algorithms
Display Area of a Circle
Algorithm
1. Constant PI = 3.142
2. Variable Radius = 10
3. Variable Area = 0.0
4. Area = PI x Radius x Radius
5. Display Area
…
PI = 3.142
…
…5. Display Area …
Radius = 40
…
Area = 0.0
…
314.2314.2
Output at monitor screen
12
Drawing the Flowchart & Writing Algorithm
Display Area of a Circle
Start
Declare & initialize
PI, Radius and Area
Algorithm
1. Declare Constant PI=3.142,
2. Variable Radius=0
Get Radius
Exit
Calculate Area
Display Area
2. Variable Radius=0
3. Variable Area=0.0
4. Get Radius
5. Area = PI x Radius x Radius
6. Display Area
13
PROGRAM STRUCTUREPROGRAM STRUCTUREPROGRAM STRUCTUREPROGRAM STRUCTURE
14
Program Structure
Use FOUR logic structures to ensure the solution flows
smoothly from one instruction to the next, rather than jumping
between points
1. Sequential structure executes instructions one after another in a
sequence
2. Decision structure branches to execute one of the possible sets of
instructionsinstructions
3. Loop structure executes a set of instructions many times
4. Case structure executes a set of instructions out of several sets
Efficient by providing smooth transformation of data into
information besides eliminating the rewriting of identical
processes
Techniques to improve program readability: the 4 logic
structure, proper naming of variables, internal documentation
and proper indentation
15
Figure 1: Sequential Logic Structure
16
Figure 2: Decision Logic Structure
17
Figure 3: Loop Logic Structure
18
Figure 4: Case Logic Structure
19
Problem Solving with Computers (e.g.)
20
Draw a flowchart to calculate bonus for an employee
based on the following table:
Annual Hours Worked Bonus
Less than 2000 hours RM 500Less than 2000 hours RM 500
Between 2000 and 2499 hours RM 500 + 1 month salary
More than 2500 hours RM500 + 2 months salary

More Related Content

PPTX
Algorithm and flowchart
PPTX
flowchart & algorithms
PPTX
Flowchart and algorithm
PPT
algo
PPTX
Flowchart and algorithem
PPTX
Algorithms and flowcharts
PPT
3 algorithm-and-flowchart
PPT
2.3 Apply the different types of algorithm to solve problem
Algorithm and flowchart
flowchart & algorithms
Flowchart and algorithm
algo
Flowchart and algorithem
Algorithms and flowcharts
3 algorithm-and-flowchart
2.3 Apply the different types of algorithm to solve problem

What's hot (20)

PPTX
Algorithm and flowchart with pseudo code
PPSX
Algorithm and flowchart
PPTX
Algorithm Development
PPTX
Algorithm and flowchart
PPTX
Introduction to flowchart
PDF
Algorithm
PPT
Computer programming:Know How to Flowchart
PPT
Algorithm and Flowcharts
PPT
Pseudocode algorithim flowchart
PPTX
Flowcharting and Algorithm
PDF
Algorithms and flowcharts
PPT
Algorithms and flowcharts ppt (seminar presentation)..
PPTX
Pseudocode-Flowchart
PPT
Unit 3 Foc
PPTX
Chapter 6 algorithms and flow charts
PPTX
Algorithms and flowcharts by Haseeb Khan
PPTX
Flowcharts and algorithms
PPTX
Programming flowcharts for C Language
PPT
Introduction to Algorithms & flow charts
Algorithm and flowchart with pseudo code
Algorithm and flowchart
Algorithm Development
Algorithm and flowchart
Introduction to flowchart
Algorithm
Computer programming:Know How to Flowchart
Algorithm and Flowcharts
Pseudocode algorithim flowchart
Flowcharting and Algorithm
Algorithms and flowcharts
Algorithms and flowcharts ppt (seminar presentation)..
Pseudocode-Flowchart
Unit 3 Foc
Chapter 6 algorithms and flow charts
Algorithms and flowcharts by Haseeb Khan
Flowcharts and algorithms
Programming flowcharts for C Language
Introduction to Algorithms & flow charts
Ad

Similar to CSC1100 - Chapter12 - Flow Charts (20)

PPTX
Introduction to programming (week 1)
PPTX
Introduction to programming (week 1)
PDF
Fundamental of Information Technology - UNIT 6
PDF
Algorithm.pdf
PPTX
Algorithms and flow charts
PPTX
Std 10 computer chapter 9 Problems and Problem Solving
PPTX
FLOWCHARTS.pptx
PPTX
Pseudo code.pptx
PDF
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
PDF
Python Unit 1.pdfPython Notes for Bharathiar university syllabus
PPTX
lecture 5
PPTX
Introduction to computer science
PPT
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
PPTX
Algorithms and Flowcharts
PDF
Logic Development and Algorithm.
PPT
Unit 1 python (2021 r)
PPT
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
PPTX
arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
PPTX
Algorithm and flowchart.pptx
PDF
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
Introduction to programming (week 1)
Introduction to programming (week 1)
Fundamental of Information Technology - UNIT 6
Algorithm.pdf
Algorithms and flow charts
Std 10 computer chapter 9 Problems and Problem Solving
FLOWCHARTS.pptx
Pseudo code.pptx
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
Python Unit 1.pdfPython Notes for Bharathiar university syllabus
lecture 5
Introduction to computer science
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
Algorithms and Flowcharts
Logic Development and Algorithm.
Unit 1 python (2021 r)
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Algorithm and flowchart.pptx
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
Ad

More from Yhal Htet Aung (20)

PDF
HIT3328 - Chapter0701 - Dialogs, Tabs and Lists
PDF
HIT3328 - Chapter0602 - Sketching Apps
PDF
HIT3328 - Chapter0601 - Menus and Lists
PDF
HIT3328 - Chapter0702 - Navigation Flow and Design Approach
PDF
HIT3328 - Chapter05 - Working with Forms
PDF
HIT3328 - Chapter02 - Foundation and Tools
PDF
HIT3328 - Chapter04 - Complex Interactions
PDF
HIT3328 - Chapter03 - Simple Interactive Apps
PDF
HIT3328 - Chapter01 - Platforms and Devices
PDF
CSC1100 - Chapter11 - Programming Languages and Program Development
PDF
CSC1100 - Chapter10 - Information System
PDF
CSC1100 - Chapter09 - Computer Security, Ethics and Privacy
PDF
CSC1100 - Chapter08 - Database Management
PDF
CSC1100 - Chapter07 - Communications & Networks
PDF
CSC1100 - Chapter06 - Operating System & Utility Programs
PDF
CSC1100 - Chapter05 - Storage
PDF
CSC1100 - Chapter04 - Output
PDF
CSC1100 - Chapter03 - Input
PDF
CSC1100 - Chapter02 - Components of the System Unit
PDF
CSC1100 - Chapter01 - Overview of Using Computers
HIT3328 - Chapter0701 - Dialogs, Tabs and Lists
HIT3328 - Chapter0602 - Sketching Apps
HIT3328 - Chapter0601 - Menus and Lists
HIT3328 - Chapter0702 - Navigation Flow and Design Approach
HIT3328 - Chapter05 - Working with Forms
HIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter04 - Complex Interactions
HIT3328 - Chapter03 - Simple Interactive Apps
HIT3328 - Chapter01 - Platforms and Devices
CSC1100 - Chapter11 - Programming Languages and Program Development
CSC1100 - Chapter10 - Information System
CSC1100 - Chapter09 - Computer Security, Ethics and Privacy
CSC1100 - Chapter08 - Database Management
CSC1100 - Chapter07 - Communications & Networks
CSC1100 - Chapter06 - Operating System & Utility Programs
CSC1100 - Chapter05 - Storage
CSC1100 - Chapter04 - Output
CSC1100 - Chapter03 - Input
CSC1100 - Chapter02 - Components of the System Unit
CSC1100 - Chapter01 - Overview of Using Computers

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Electronic commerce courselecture one. Pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
cuic standard and advanced reporting.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The AUB Centre for AI in Media Proposal.docx
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
Electronic commerce courselecture one. Pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
MIND Revenue Release Quarter 2 2025 Press Release
Spectral efficient network and resource selection model in 5G networks
Reach Out and Touch Someone: Haptics and Empathic Computing
Review of recent advances in non-invasive hemoglobin estimation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Understanding_Digital_Forensics_Presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25 Week I
cuic standard and advanced reporting.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

CSC1100 - Chapter12 - Flow Charts

  • 2. 2 Problem Solving Can be solved in a series of actions Problem solving steps: 1. Identify the problem 2. Understand the problem 3. Identify alternatives (solutions) 4. Select the best solution4. Select the best solution 5. Prepare a list of steps (instruction) 6. Evaluate the solution
  • 3. 3 SOLUTIONS Algorithmic Heuristic the best alternative solution reached by completing actions in steps – algorithm cannot be reached through direct set of steps – require reasoning built on knowledge & experience – a process of trial & error
  • 4. 4 Problem Solving with Computers Solution instructions listed during step 5 of problem solving – must be followed to produce best results Result The outcome or completed computer-assisted answer Program Computers deal with algorithmic solutions & heuristic solutions (artificial intelligence) Program set of instructions that make up the solution after they have been coded into a particular computer language
  • 5. 5 Constants & Variables Constant An alphabetical and/or numerical value that never changes during the processing of all the instructions in a solution Variable (identifiers) May change during processing Given a name & a location in memory - Referred to by given name
  • 6. 6 Drawing the Flowcharts Connect blocks by exiting from one and entering another The arrowhead is necessary FLOWLINESFLOWLINES Indicate the start & end of a program StartStart has one flowline exiting ExitExit has one flowline entering StartStart ExitExit
  • 7. 7 Drawing the Flowcharts (cont.) For calculations,… Has one flowline entering and one exiting PROCESSINGPROCESSING Indicates input to and output from the computer memory Has one entrance & one exit I/OI/O
  • 8. 8 Drawing the Flowcharts (cont.) Indicates a decision Has one entrance & two exits One exit is the action when the resultant is TRUE & other exit is the action when the resultant is FALSEDecisionDecision i < 10 T F Display “i is less than 10” ExitExit
  • 9. 9 Problem Solving with Computers Problem: Display Area of a Circle Steps to solve the problem: 1. Declare & Initialize PI value 2. Declare & Initialize Radius value 3. Declare & Initialize Area value 4. Calculate Area 5. Display the value of Area
  • 10. 10 Drawing the Flowchart & Writing Algorithm Display Area of a Circle Start Declare & initialize PI, Radius and Area Algorithm 1. Constant PI = 3.142 2. Variable Radius = 10 Exit Calculate Area Display Area 2. Variable Radius = 10 3. Variable Area = 0.0 4. Area = PI x Radius x Radius 5. Display Area
  • 11. 11 Writing the Algorithms Display Area of a Circle Algorithm 1. Constant PI = 3.142 2. Variable Radius = 10 3. Variable Area = 0.0 4. Area = PI x Radius x Radius 5. Display Area … PI = 3.142 … …5. Display Area … Radius = 40 … Area = 0.0 … 314.2314.2 Output at monitor screen
  • 12. 12 Drawing the Flowchart & Writing Algorithm Display Area of a Circle Start Declare & initialize PI, Radius and Area Algorithm 1. Declare Constant PI=3.142, 2. Variable Radius=0 Get Radius Exit Calculate Area Display Area 2. Variable Radius=0 3. Variable Area=0.0 4. Get Radius 5. Area = PI x Radius x Radius 6. Display Area
  • 13. 13 PROGRAM STRUCTUREPROGRAM STRUCTUREPROGRAM STRUCTUREPROGRAM STRUCTURE
  • 14. 14 Program Structure Use FOUR logic structures to ensure the solution flows smoothly from one instruction to the next, rather than jumping between points 1. Sequential structure executes instructions one after another in a sequence 2. Decision structure branches to execute one of the possible sets of instructionsinstructions 3. Loop structure executes a set of instructions many times 4. Case structure executes a set of instructions out of several sets Efficient by providing smooth transformation of data into information besides eliminating the rewriting of identical processes Techniques to improve program readability: the 4 logic structure, proper naming of variables, internal documentation and proper indentation
  • 15. 15 Figure 1: Sequential Logic Structure
  • 16. 16 Figure 2: Decision Logic Structure
  • 17. 17 Figure 3: Loop Logic Structure
  • 18. 18 Figure 4: Case Logic Structure
  • 19. 19 Problem Solving with Computers (e.g.)
  • 20. 20 Draw a flowchart to calculate bonus for an employee based on the following table: Annual Hours Worked Bonus Less than 2000 hours RM 500Less than 2000 hours RM 500 Between 2000 and 2499 hours RM 500 + 1 month salary More than 2500 hours RM500 + 2 months salary