SlideShare a Scribd company logo
DFC1023
PROBLEM SOLVING & PROGRAM DESIGN
CHAPTER 2:
PROBLEM SOLVING METHODS
S U B T O P I C 2 . 3 : T Y P E O F A L G O R I T H M
( F L O W C H A R T A N D P S E U D O C O D E )
AT THE END OF THIS CHAPTER, STUDENTS
SHOULD BE ABLE TO:
1. Apply Different types of algorithm to solve problem.
 Various types of algorithm
 Distinguish and solve problems using Flowchart and
pseudo code
2. Problem solving tools to solve problems
 Use RAPTOR software to solve problems
CHARACTERISTICS OF AN ALGORITHM
There are 4 essential properties of an algorithm:
i. Each step of an algorithm must be exact (tepat)
 must be precisely and unambiguously described,
ii. An algorithm must terminate
 If the program does not stop when executed, we will
not be able to get any result from it.
iii. An algorithm must be effective.
 must provide the correct answer to the problem
iv. An algorithm must be general.
 it must solve every instance of the problem.
VARIOUS TYPES OF ALGORITHM
 Usually present algorithms in the form of some pseudo code, which a
mixture of:
English statement.
Some mathematical notation.
Selected keywords from programming language.
 Algorithms may also be represented by diagrams.
 One popular diagrammatic method is the flowchart, which consists of:
 Terminator boxes
 Process boxes
 Decision boxes
 Flows of logic indicated by arrows.
DISTINGUISH BETWEEN FLOWCHART AND PSEUDO CODE
Flowchart Pseudo code
Definition A graphical representation
of instructions done in
problem using certain
symbols that are
connected to flow lines.
Steps in problem solving
that is written half in
programming code and half
in human language.
Use work well for
small problems .
used for larger problems.
Statement
or symbols
used
diagrammatic method
which consists of
terminator boxes, process
boxes, and decision boxes,
with flows of logic
indicated by arrows.
mixture of English
statement, Some
mathematical notation,
selected keywords from
programming language.
FLOW CHART SIMBOL
Symbol Function
Start / End
Process
Input / Output
Condition
Flow lines
connector
EXERCISE 1
Ms Nurain want to solve problems involving the total sales of two
pieces of cloths and two pieces of shawl. Given the price of a piece
of cloth is RM45.00 and the price of the shawl is RM23.00.
Find the:
1. Problem Analysis
2. Algorithm
3. Flowchart
4. Pseudo code
PROBLEM ANALYSIS
Input: NoOfCloth , NoOfShawl
Process: 1. Set PriceCloth = 45.00, PriceShawl = 23.00
2. Calculate charges purchase using formula:
Sales = (NoOfCloth * PriceCloth)+(NoOfShawl *
PriceShawl)
Output: Sales
ALGORITHM
1. Set PriceCloth = 45.00, PriceShawl = 23.00
2. Input NoOfCloth , NoOfShawl
3. Calculate charges purchase using formula:
Sales = (NoOfCloth * PriceCloth)+(NoOfShawl * PriceShawl)
4. Print Sales
FLOW CHART
Input NoOfCloth, No OfShawl
Sales = (NoOfCloth * PriceCloth)+(NoOfShawl * PriceShawl)
Print Sales
Start
Set PriceCloth = 45.00, PriceShawl = 23.00
End
PSEUDO CODE
START
Set PriceCloth = 34.00, PriceShawl = 23.00;
Input NoOfCloth , NoOfShawl;
Sales = (NoOfCloth*PriceCloth)+(NoOfShawl*Price Shawl)
Print Sales;
END
EXERCISE 2
Ms Khadijah want to calculate the area of circle.
Find the:
1. Problem Analysis
2. Algorithm
3. Flowchart
4. Pseudo code

More Related Content

PDF
POLITEKNIK MALAYSIA
PDF
POLITEKNIK MALAYSIA
PDF
POLITEKNIK MALAYSIA
PDF
POLITEKNIK MALAYSIA
PPTX
FIT-Unit3 chapter 1 -computer program
PPTX
Unit 1. Problem Solving with Computer
PPTX
Introduction to computer science
PPTX
Software develop....
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
FIT-Unit3 chapter 1 -computer program
Unit 1. Problem Solving with Computer
Introduction to computer science
Software develop....

What's hot (20)

PDF
Problem Solving Techniques and Introduction to C
PPTX
Algorithm & flowchart
PDF
Decision Making Statements, Arrays, Strings
PPT
Steps for Developing a 'C' program
PPTX
Algorithm and flowchart with pseudo code
PPTX
Flowcharts and algorithms
PPT
Problem solving using Computer
PPT
Algorithm and Flowcharts
PPTX
Algorithm and flowchart2010
PPSX
Algorithm and flowchart
PPTX
Programming Fundamentals
PPTX
Algorithm and flowchart
PPT
Program design and problem solving techniques
PPTX
phases of algorithm
PPTX
Programming flowcharts for C Language
PPT
Class 7 lecture notes
PPTX
Algorithm and Flowcharts
PPTX
flowchart & algorithms
PPT
Introduction to Algorithms & flow charts
Problem Solving Techniques and Introduction to C
Algorithm & flowchart
Decision Making Statements, Arrays, Strings
Steps for Developing a 'C' program
Algorithm and flowchart with pseudo code
Flowcharts and algorithms
Problem solving using Computer
Algorithm and Flowcharts
Algorithm and flowchart2010
Algorithm and flowchart
Programming Fundamentals
Algorithm and flowchart
Program design and problem solving techniques
phases of algorithm
Programming flowcharts for C Language
Class 7 lecture notes
Algorithm and Flowcharts
flowchart & algorithms
Introduction to Algorithms & flow charts
Ad

Similar to POLITEKNIK MALAYSIA (20)

PDF
Algorithm.pdf
PPTX
Lec 2 -algorithms-flowchart-and-pseudocode1.pptx
PPTX
PRESENTATION 0N SCHEDULING ALGORITHM.pptx
PDF
Problem solving methodology
PDF
Algorithms notes 2 tutorials duniya
PPTX
PRESENTATION 0N ALGORITHM AND FLOWCHART.pptx
PPTX
Algorithms and flow charts
PPTX
asic computer is an electronic device that can receive, store, process, and o...
PDF
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
PDF
Study Material for Problem Solving Techniques
PDF
Algorithm pseudocode flowchart program notes
PDF
Python Unit 1.pdfPython Notes for Bharathiar university syllabus
PPTX
Module 1 python.pptx
PPT
3 algorithm-and-flowchart
PPTX
introduction to computing & programming
PPSX
Ic lecture7
PPTX
Algorithm Design & Implementation
PPTX
Algorithm to programs.pptx
DOCX
Chapter 2(1)
PPTX
PCCF UNIT 1.pptx
Algorithm.pdf
Lec 2 -algorithms-flowchart-and-pseudocode1.pptx
PRESENTATION 0N SCHEDULING ALGORITHM.pptx
Problem solving methodology
Algorithms notes 2 tutorials duniya
PRESENTATION 0N ALGORITHM AND FLOWCHART.pptx
Algorithms and flow charts
asic computer is an electronic device that can receive, store, process, and o...
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
Study Material for Problem Solving Techniques
Algorithm pseudocode flowchart program notes
Python Unit 1.pdfPython Notes for Bharathiar university syllabus
Module 1 python.pptx
3 algorithm-and-flowchart
introduction to computing & programming
Ic lecture7
Algorithm Design & Implementation
Algorithm to programs.pptx
Chapter 2(1)
PCCF UNIT 1.pptx
Ad

More from Aiman Hud (20)

PDF
POLITEKNIK MALAYSIA
PDF
POLITEKNIK MALAYSIA
PDF
POLITEKNIK MALAYSIA
PDF
POLITEKNIK MALAYSIA
PDF
POLITEKNIK MALAYSIA
PPT
POLITEKNIK MALAYSIA
PPTX
POLITEKNIK MALAYSIA
PPT
POLITEKNIK MALAYSIA
PPT
POLITEKNIK MALAYSIA
PPT
POLITEKNIK MALAYSIA
PPTX
POLITEKNIK MALAYSIA
PPT
POLITEKNIK MALAYSIA
PDF
POLITEKNIK MALAYSIA
PPT
POLITEKNIK MALAYSIA
PPTX
POLITEKNIK MALAYSIA
PPTX
POLITEKNIK MALAYSIA
PPTX
POLITEKNIK MALAYSIA
PPTX
POLITEKNIK MALAYSIA
PPT
POLITEKNIK MALAYSIA
PPT
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA

Recently uploaded (20)

PPTX
Safe Confined Space Entry Monitoring_ Singapore Experts.pptx
PDF
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...
PPTX
Hire Expert Blazor Developers | Scalable Solutions by OnestopDA
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Odoo Consulting Services by CandidRoot Solutions
PPTX
Materi_Pemrograman_Komputer-Looping.pptx
PPTX
How a Careem Clone App Allows You to Compete with Large Mobility Brands
PDF
Jenkins: An open-source automation server powering CI/CD Automation
PDF
Become an Agentblazer Champion Challenge Kickoff
PPTX
Mastering-Cybersecurity-The-Crucial-Role-of-Antivirus-Support-Services.pptx
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
PPTX
AIRLINE PRICE API | FLIGHT API COST |
PPTX
Online Work Permit System for Fast Permit Processing
PDF
How to Confidently Manage Project Budgets
PDF
Best Practices for Rolling Out Competency Management Software.pdf
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
PPTX
Lecture #1.ppt.pptx, Visuals Programming
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
Safe Confined Space Entry Monitoring_ Singapore Experts.pptx
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...
Hire Expert Blazor Developers | Scalable Solutions by OnestopDA
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
2025 Textile ERP Trends: SAP, Odoo & Oracle
Odoo Consulting Services by CandidRoot Solutions
Materi_Pemrograman_Komputer-Looping.pptx
How a Careem Clone App Allows You to Compete with Large Mobility Brands
Jenkins: An open-source automation server powering CI/CD Automation
Become an Agentblazer Champion Challenge Kickoff
Mastering-Cybersecurity-The-Crucial-Role-of-Antivirus-Support-Services.pptx
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
AIRLINE PRICE API | FLIGHT API COST |
Online Work Permit System for Fast Permit Processing
How to Confidently Manage Project Budgets
Best Practices for Rolling Out Competency Management Software.pdf
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Lecture #1.ppt.pptx, Visuals Programming
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Materi-Enum-and-Record-Data-Type (1).pptx

POLITEKNIK MALAYSIA

  • 1. DFC1023 PROBLEM SOLVING & PROGRAM DESIGN CHAPTER 2: PROBLEM SOLVING METHODS S U B T O P I C 2 . 3 : T Y P E O F A L G O R I T H M ( F L O W C H A R T A N D P S E U D O C O D E )
  • 2. AT THE END OF THIS CHAPTER, STUDENTS SHOULD BE ABLE TO: 1. Apply Different types of algorithm to solve problem.  Various types of algorithm  Distinguish and solve problems using Flowchart and pseudo code 2. Problem solving tools to solve problems  Use RAPTOR software to solve problems
  • 3. CHARACTERISTICS OF AN ALGORITHM There are 4 essential properties of an algorithm: i. Each step of an algorithm must be exact (tepat)  must be precisely and unambiguously described, ii. An algorithm must terminate  If the program does not stop when executed, we will not be able to get any result from it. iii. An algorithm must be effective.  must provide the correct answer to the problem iv. An algorithm must be general.  it must solve every instance of the problem.
  • 4. VARIOUS TYPES OF ALGORITHM  Usually present algorithms in the form of some pseudo code, which a mixture of: English statement. Some mathematical notation. Selected keywords from programming language.  Algorithms may also be represented by diagrams.  One popular diagrammatic method is the flowchart, which consists of:  Terminator boxes  Process boxes  Decision boxes  Flows of logic indicated by arrows.
  • 5. DISTINGUISH BETWEEN FLOWCHART AND PSEUDO CODE Flowchart Pseudo code Definition A graphical representation of instructions done in problem using certain symbols that are connected to flow lines. Steps in problem solving that is written half in programming code and half in human language. Use work well for small problems . used for larger problems. Statement or symbols used diagrammatic method which consists of terminator boxes, process boxes, and decision boxes, with flows of logic indicated by arrows. mixture of English statement, Some mathematical notation, selected keywords from programming language.
  • 6. FLOW CHART SIMBOL Symbol Function Start / End Process Input / Output Condition Flow lines connector
  • 7. EXERCISE 1 Ms Nurain want to solve problems involving the total sales of two pieces of cloths and two pieces of shawl. Given the price of a piece of cloth is RM45.00 and the price of the shawl is RM23.00. Find the: 1. Problem Analysis 2. Algorithm 3. Flowchart 4. Pseudo code
  • 8. PROBLEM ANALYSIS Input: NoOfCloth , NoOfShawl Process: 1. Set PriceCloth = 45.00, PriceShawl = 23.00 2. Calculate charges purchase using formula: Sales = (NoOfCloth * PriceCloth)+(NoOfShawl * PriceShawl) Output: Sales
  • 9. ALGORITHM 1. Set PriceCloth = 45.00, PriceShawl = 23.00 2. Input NoOfCloth , NoOfShawl 3. Calculate charges purchase using formula: Sales = (NoOfCloth * PriceCloth)+(NoOfShawl * PriceShawl) 4. Print Sales
  • 10. FLOW CHART Input NoOfCloth, No OfShawl Sales = (NoOfCloth * PriceCloth)+(NoOfShawl * PriceShawl) Print Sales Start Set PriceCloth = 45.00, PriceShawl = 23.00 End
  • 11. PSEUDO CODE START Set PriceCloth = 34.00, PriceShawl = 23.00; Input NoOfCloth , NoOfShawl; Sales = (NoOfCloth*PriceCloth)+(NoOfShawl*Price Shawl) Print Sales; END
  • 12. EXERCISE 2 Ms Khadijah want to calculate the area of circle. Find the: 1. Problem Analysis 2. Algorithm 3. Flowchart 4. Pseudo code