SlideShare a Scribd company logo
Universiti Tun Hussien Onn Malaysia Faculty of Mechanical and Manufacturing Engineering
Scenarios in real life Withdraw money from ATM machine Register subjects through online system Buy cold drinks from vending machine Calculate the monthly salary payment Calculate car loan interest Determine odd and even numbers Count the total visitor of a Web Determine air velocity in physic lab Program Design Method
Go to the ATM machine. Insert ATM card. Select language. Enter pin number. Select withdrawal option from menu. Enter amount of money to withdraw. Take the money. Take the bank slip. Example 2: Money withdrawal algorithm Program Design Method
Algorithm Techniques Pseudocode Flowchart Program Design Method
A text-based design tool that helps programmers to develop algorithm Pseudocode Compact and informal high level  language description of a computer programming algorithm Simple codes which resembles program code that will be written during implementation phase (program coding) Program Design Method Using natural language (communication language e.g: Malay/English) wording phrase
Pseudocode RULES Program Design Method Consist of a statement of instructions in sequence Every step consists of keyword Every step should be written in different step, if continued,  thru next row must be indented if/else for condition, while/do for repetition Every step must contain clear statement and easy to understand Use start for beginning of operation, and end/halt for finishing it.
Computing Sales Tax : Pseudo-code the task of computing the final price of an item after figuring in sales tax. Note the three types of instructions: Input (get or read), process/calculate (=) and output (display) Start get price of item get sales tax rate sales tax = price of item * sales tax rate Final price = price of item + sales tax display final price 7 halt/end Program Design Method Examples
if student's  grade  is greater than or equal to 60  print the statement "passed"  else  print the statement  "failed"  Examples Keyword ? print means display on the screen monitor if  credit_card_number  is valid  execute transaction based on number and order  else  show a generic failure message show also means display on the screen monitor Program Design Method
Set  total  to zero  Set  grade_counter  to one  While  grade_counter  is less than or equal to ten  Input the next  grade Add the  grade  into the  total  Set the  class_average  to the  total  divided by ten  Print the  class_average .  Examples Keyword? set  means assign the value,e.g: total = 0 while  is used whenever the process is to be continued Program Design Method
Pseudocode Write the pseudo code based on the  IPO (input/process/ output)  which you have identified during the analyzing  phase Identify the keyword(s) based on the IPO How? Chapter 1 Program Design Method
Problem example Input Value of   x   and   a Process Replace the value of   x   and   a   in the formula, y = 2x +a -6 Output The value of the equation,   y Identify the problem Chapter 1 Program Design Method Example 1:
Given the value of  x  is 10 and  a  is 12,  find the result of the following equation: y = 2x + a - 6 Example 1 start read the value of  x read the value of  a compute the value of  y  as y = 2x + a -6 display/print  the result (or the value of  y ) end Pseudocode Write a program! Keyword Program Design Method
Uncle Degawan wants to buy 5 tins of paint from  Cinda’s shop. The price of each tin of the paint is  RM 15.60. Calculate the price which Uncle Degawan have to pay for all the tin of paints he bought. start read the  amount_of_paint compute the  total_price  as  price_per_tin  times by  amount_of  _paint display/print  the result (or the  total_price ) end Pseudocode Write a program! Keyword? Program Design Method
start read the student  mark if  mark  is greater than 85 and  mark  is less than 100, then set  grade  as A display/print the  grade end Pseudocode Keyword Keyword Keyword Program Design Method
start Set  total  to zero Set  grade counter  to one While  grade   counter  is less than or equal to ten input the next  grade add the  grade  into the  total add one to the  grade counter Set the class  average  to the  total  divided by  ten Print the class  average end Pseudocode Keyword Keyword Keyword Program Design Method
Question Program Design Method
Flowchart Schematic representation of an algorithm or process Helps to visualize the content/steps better or to find flaws in process Illustrate the steps in the process Use symbols to represent the steps Chapter 1b Program Design Method
Flowchart Symbols Chapter 1b Program Design Method Start/Stop (oval) The terminator symbol marks the starting or ending point of the system. It usually contains the word "Start" or "End."   Action or Process (rectangle) A box can represent a single step ("add two cups of flour"), or and entire sub-process ("make bread") within a larger process.
Flowchart Symbols Chapter 1 Program Design Method Decision (Diamond) A decision or branching point. Lines representing different decisions emerge from different points of the diamond.   Input/Output (Parallelogram) Represents material or information entering or leaving the system, such as customer order (input) or a product (output).
Flowchart Symbols Chapter 1 Program Design Method Flow Lines Lines indicate the sequence of steps and the direction of flow.  On-Page Connector Indicates that the flow continues where a matching symbol (containing the same letter) has been placed in the same page.
Flowchart Symbols Chapter 1 Program Design Method Off-Page Connector Indicates that the process continues on another page. Database / Disk Storage Input-Output Symbol Indicates input from or output to disk storage.
Flowchart Example Chapter 1 Program Design Method
Example What software use to draw flowchart? You can use Ms Word >  AutoShapes> Flowchart or other flowchart drawing tools  e.g: SmartDraw/Visio Drawing, Rational Rose,etc. Flowchart Chapter 1 Program Design Method
Chapter 1 Program Design Method Pseudocode and Flowchart Convention 1. Sequence Structure    a series of steps or statements that are executed in order. begin Statement_1 Statement_2 … Statement_n end Statement 1 Statement 2 Statement..n
Flowchart Example Chapter 1 Program Design Method Read  x Read  a y = 2x + a - 6 Display  y Start End
Chapter 1 Program Design Method Pseudo code and Flowchart Convention 2. Selection Structure    Define two courses of action depending on the outcome condition  ( true or false)
Flowchart Chapter 1 Program Design Method Pseudocode How to go to BP Mall ? 1.  Begin 2.  Do you have a car ? 3.  If yes,  drive your car towards BP Mall 4.  Or else go by bus 5.  Reach BP Mall  6.  End
Program Design Method 3 . Repetition Control Structures    Specifies a block of one or more statements that are repeatedly  executed until a condition is satisfied . while condition loop-body end_while Pseudo code and Flowchart Convention
start Set  total  to zero Set  grade_counter  to one While  grade _ counter  is less than or equal to ten input the next  grade add the  grade  into the  total add one to the  grade_counter Set the class  average  to the  total  divided by  ten Print the class  average end Pseudocode Chapter 1 Program Design Method Flowchart How ?
start read the  amount_of_paint compute the  total_price  as  price_per_tin  times by  amount_of  paint display/print  the result (or the  total price ) end start read the student  mark if  mark  is greater than 85 and  mark  is less than 100, then set  grade  as A display/print the  grade end Try yourself! Convert to flowchar Convert to flowchart Chapter 1 Program Design Method
A box has height, width and length.  Write the  pseudo code to calculate the volume  of a box. Write the pseudo code to calculate salary of  an employee for a month. Convert to Convert to flowchart Try yourself! Program Design Method
Question Chapter 1 Program Design Method

More Related Content

What's hot (20)

PPT
3 algorithm-and-flowchart
Rohit Shrivastava
 
PPT
Programing Fundamental
Qazi Shahzad Ali
 
PPT
Algorithms and flowcharts ppt (seminar presentation)..
Nagendra N
 
PPTX
Flowchart and algorithm
DHANIK VIKRANT
 
PPT
algo
Rao Khan
 
PPTX
Flowchart and algorithem
ehsanullah786
 
PPTX
Algorithms and flowcharts by Haseeb Khan
Haseeb Shalmani
 
PDF
Algorithms and flowcharts
khair20
 
PPT
Algorithmsandflowcharts1
luhkahreth
 
PPTX
Algorithmsandflowcharts1
Emmanuel Alimpolos
 
PDF
Algorithms and how to write an algorithms
Ahmed Nobi
 
PPT
Algorithmsandflowcharts1
rajnidhiman
 
PPT
Introduction to Algorithms & flow charts
Yash Gupta
 
PPT
8.1 alogorithm & prolem solving
Khan Yousafzai
 
PPT
Program design techniques
fika sweety
 
PPT
Best Techniques To Design Programs - Program Designing Techniques
Tech
 
PPTX
Algorithm and flowchart
Rabin BK
 
PPT
Unit 3 Foc
JAYA
 
PDF
Writing algorithms
Krishna Chaytaniah
 
3 algorithm-and-flowchart
Rohit Shrivastava
 
Programing Fundamental
Qazi Shahzad Ali
 
Algorithms and flowcharts ppt (seminar presentation)..
Nagendra N
 
Flowchart and algorithm
DHANIK VIKRANT
 
algo
Rao Khan
 
Flowchart and algorithem
ehsanullah786
 
Algorithms and flowcharts by Haseeb Khan
Haseeb Shalmani
 
Algorithms and flowcharts
khair20
 
Algorithmsandflowcharts1
luhkahreth
 
Algorithmsandflowcharts1
Emmanuel Alimpolos
 
Algorithms and how to write an algorithms
Ahmed Nobi
 
Algorithmsandflowcharts1
rajnidhiman
 
Introduction to Algorithms & flow charts
Yash Gupta
 
8.1 alogorithm & prolem solving
Khan Yousafzai
 
Program design techniques
fika sweety
 
Best Techniques To Design Programs - Program Designing Techniques
Tech
 
Algorithm and flowchart
Rabin BK
 
Unit 3 Foc
JAYA
 
Writing algorithms
Krishna Chaytaniah
 

Viewers also liked (20)

PDF
Management information system mordern perspective
Yekini Nureni
 
DOCX
Bti1022 lab sheet 8
alish sha
 
PPTX
Bahan kuiz p2 27 march
nm170209
 
PPTX
Presentation2
sanggabuana
 
PPT
Books to Read
nplisko
 
PPTX
Ways of looking 2
amandakane1
 
XLS
Attn list test
alish sha
 
PDF
Roda + Fields Business System Presentation 041511 Copy
Rodan + Fields Dermatologists
 
PPT
تأثير تقنية الاتصال الشخصي على الشباب
haya5
 
PPT
Materiales
juanapardo
 
PPTX
TiemTapHoa
Linh Vo
 
DOCX
Bti1022 lab sheet 7
alish sha
 
PPT
Let's Enjoy Our Vacation
Dhevita Marianna
 
PPS
3 keuzes
Dandy1979
 
PPTX
WLC AAR
armychef
 
PPS
Rediscover india
Ikjot Sodhi
 
PPTX
Literary Terms
Ysamar Sánchez D
 
PDF
الأسبوع السابع
Sunflower Al-mahrouqi
 
PPTX
تعليمات السلامة
Sunflower Al-mahrouqi
 
DOC
Tema 2 cmc
juanapardo
 
Management information system mordern perspective
Yekini Nureni
 
Bti1022 lab sheet 8
alish sha
 
Bahan kuiz p2 27 march
nm170209
 
Presentation2
sanggabuana
 
Books to Read
nplisko
 
Ways of looking 2
amandakane1
 
Attn list test
alish sha
 
Roda + Fields Business System Presentation 041511 Copy
Rodan + Fields Dermatologists
 
تأثير تقنية الاتصال الشخصي على الشباب
haya5
 
Materiales
juanapardo
 
TiemTapHoa
Linh Vo
 
Bti1022 lab sheet 7
alish sha
 
Let's Enjoy Our Vacation
Dhevita Marianna
 
3 keuzes
Dandy1979
 
WLC AAR
armychef
 
Rediscover india
Ikjot Sodhi
 
Literary Terms
Ysamar Sánchez D
 
الأسبوع السابع
Sunflower Al-mahrouqi
 
تعليمات السلامة
Sunflower Al-mahrouqi
 
Tema 2 cmc
juanapardo
 
Ad

Similar to Copy of dti2143/dam31303 chap 1 problem solving and program design (20)

PPT
Chap3
cheekeong1231
 
PPT
Chapter 2- Prog101.ppt
JosephObadiahTuray
 
PPT
Class 7 lecture notes
Stephen Parsons
 
PDF
AlgorithmAndFlowChart.pdf
SusieMaestre1
 
PPTX
Pseudocode-Flowchart
lotlot
 
PPTX
Programming Fundamentals
Trivuz ত্রিভুজ
 
PPT
Basic Slides on Algorithms and Flowcharts
moazwinner
 
PPTX
Software develop....
GCWUS
 
PPT
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
ReshuReshma8
 
PPT
Class 8 Lecture Notes
Stephen Parsons
 
PPT
Lect1-Detailed description aboutAlgorithms-and-Flowchart.ppt
gstagra
 
PPT
Lect1 - Algorithms-and-Flowchart-ppt.ppt
KARMANAYGUPTA1
 
PPT
Lect1-Algorithms-and-Flowchart-ppt (1).ppt
olisahchristopher
 
PPT
Lect1-Algorithms-and-Flowchart PPT presentation
gstagra
 
PPT
Lecture1-Algorithms-and-Flowchart-ppt.ppt
samreen82
 
PPT
learn computer science.ppt
faithola1
 
PPT
Algorithms and Flowchart usages in C laguage
BalaKrishnan466
 
PPT
Ch1 principles of software development
Hattori Sidek
 
PPT
Lesson 3
Dr. Rupinder Singh
 
PPTX
Algorithm
Cambriannews
 
Chapter 2- Prog101.ppt
JosephObadiahTuray
 
Class 7 lecture notes
Stephen Parsons
 
AlgorithmAndFlowChart.pdf
SusieMaestre1
 
Pseudocode-Flowchart
lotlot
 
Programming Fundamentals
Trivuz ত্রিভুজ
 
Basic Slides on Algorithms and Flowcharts
moazwinner
 
Software develop....
GCWUS
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
ReshuReshma8
 
Class 8 Lecture Notes
Stephen Parsons
 
Lect1-Detailed description aboutAlgorithms-and-Flowchart.ppt
gstagra
 
Lect1 - Algorithms-and-Flowchart-ppt.ppt
KARMANAYGUPTA1
 
Lect1-Algorithms-and-Flowchart-ppt (1).ppt
olisahchristopher
 
Lect1-Algorithms-and-Flowchart PPT presentation
gstagra
 
Lecture1-Algorithms-and-Flowchart-ppt.ppt
samreen82
 
learn computer science.ppt
faithola1
 
Algorithms and Flowchart usages in C laguage
BalaKrishnan466
 
Ch1 principles of software development
Hattori Sidek
 
Algorithm
Cambriannews
 
Ad

More from alish sha (20)

PPTX
T22016 – how to answer with ubs 9
alish sha
 
PPTX
July 2014 theory exam (theory)
alish sha
 
PPTX
Accounting basic equation
alish sha
 
PPTX
It 302 computerized accounting (week 2) - sharifah
alish sha
 
PPTX
It 302 computerized accounting (week 1) - sharifah
alish sha
 
PPTX
What are the causes of conflicts (Bahasa Malaysia)
alish sha
 
DOC
Lab 9 sem ii_12_13
alish sha
 
DOCX
Lab 10 sem ii_12_13
alish sha
 
DOC
Lab 6
alish sha
 
DOC
Lab 5 2012/2012
alish sha
 
DOCX
Purpose elaborate
alish sha
 
DOC
Lab sheet 1
alish sha
 
DOC
Test 1 alish schema 1
alish sha
 
DOC
Lab 6 sem ii_11_12
alish sha
 
PDF
Test 1 skema q&a
alish sha
 
PDF
Test 1 skema q&a
alish sha
 
DOC
Final project
alish sha
 
DOCX
Final project
alish sha
 
PDF
Carry markdam31303
alish sha
 
DOCX
Final project
alish sha
 
T22016 – how to answer with ubs 9
alish sha
 
July 2014 theory exam (theory)
alish sha
 
Accounting basic equation
alish sha
 
It 302 computerized accounting (week 2) - sharifah
alish sha
 
It 302 computerized accounting (week 1) - sharifah
alish sha
 
What are the causes of conflicts (Bahasa Malaysia)
alish sha
 
Lab 9 sem ii_12_13
alish sha
 
Lab 10 sem ii_12_13
alish sha
 
Lab 6
alish sha
 
Lab 5 2012/2012
alish sha
 
Purpose elaborate
alish sha
 
Lab sheet 1
alish sha
 
Test 1 alish schema 1
alish sha
 
Lab 6 sem ii_11_12
alish sha
 
Test 1 skema q&a
alish sha
 
Test 1 skema q&a
alish sha
 
Final project
alish sha
 
Final project
alish sha
 
Carry markdam31303
alish sha
 
Final project
alish sha
 

Recently uploaded (20)

PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 

Copy of dti2143/dam31303 chap 1 problem solving and program design

  • 1. Universiti Tun Hussien Onn Malaysia Faculty of Mechanical and Manufacturing Engineering
  • 2. Scenarios in real life Withdraw money from ATM machine Register subjects through online system Buy cold drinks from vending machine Calculate the monthly salary payment Calculate car loan interest Determine odd and even numbers Count the total visitor of a Web Determine air velocity in physic lab Program Design Method
  • 3. Go to the ATM machine. Insert ATM card. Select language. Enter pin number. Select withdrawal option from menu. Enter amount of money to withdraw. Take the money. Take the bank slip. Example 2: Money withdrawal algorithm Program Design Method
  • 4. Algorithm Techniques Pseudocode Flowchart Program Design Method
  • 5. A text-based design tool that helps programmers to develop algorithm Pseudocode Compact and informal high level language description of a computer programming algorithm Simple codes which resembles program code that will be written during implementation phase (program coding) Program Design Method Using natural language (communication language e.g: Malay/English) wording phrase
  • 6. Pseudocode RULES Program Design Method Consist of a statement of instructions in sequence Every step consists of keyword Every step should be written in different step, if continued, thru next row must be indented if/else for condition, while/do for repetition Every step must contain clear statement and easy to understand Use start for beginning of operation, and end/halt for finishing it.
  • 7. Computing Sales Tax : Pseudo-code the task of computing the final price of an item after figuring in sales tax. Note the three types of instructions: Input (get or read), process/calculate (=) and output (display) Start get price of item get sales tax rate sales tax = price of item * sales tax rate Final price = price of item + sales tax display final price 7 halt/end Program Design Method Examples
  • 8. if student's grade is greater than or equal to 60 print the statement "passed" else print the statement "failed" Examples Keyword ? print means display on the screen monitor if credit_card_number is valid execute transaction based on number and order else show a generic failure message show also means display on the screen monitor Program Design Method
  • 9. Set total to zero Set grade_counter to one While grade_counter is less than or equal to ten Input the next grade Add the grade into the total Set the class_average to the total divided by ten Print the class_average . Examples Keyword? set means assign the value,e.g: total = 0 while is used whenever the process is to be continued Program Design Method
  • 10. Pseudocode Write the pseudo code based on the IPO (input/process/ output) which you have identified during the analyzing phase Identify the keyword(s) based on the IPO How? Chapter 1 Program Design Method
  • 11. Problem example Input Value of x and a Process Replace the value of x and a in the formula, y = 2x +a -6 Output The value of the equation, y Identify the problem Chapter 1 Program Design Method Example 1:
  • 12. Given the value of x is 10 and a is 12, find the result of the following equation: y = 2x + a - 6 Example 1 start read the value of x read the value of a compute the value of y as y = 2x + a -6 display/print the result (or the value of y ) end Pseudocode Write a program! Keyword Program Design Method
  • 13. Uncle Degawan wants to buy 5 tins of paint from Cinda’s shop. The price of each tin of the paint is RM 15.60. Calculate the price which Uncle Degawan have to pay for all the tin of paints he bought. start read the amount_of_paint compute the total_price as price_per_tin times by amount_of _paint display/print the result (or the total_price ) end Pseudocode Write a program! Keyword? Program Design Method
  • 14. start read the student mark if mark is greater than 85 and mark is less than 100, then set grade as A display/print the grade end Pseudocode Keyword Keyword Keyword Program Design Method
  • 15. start Set total to zero Set grade counter to one While grade counter is less than or equal to ten input the next grade add the grade into the total add one to the grade counter Set the class average to the total divided by ten Print the class average end Pseudocode Keyword Keyword Keyword Program Design Method
  • 17. Flowchart Schematic representation of an algorithm or process Helps to visualize the content/steps better or to find flaws in process Illustrate the steps in the process Use symbols to represent the steps Chapter 1b Program Design Method
  • 18. Flowchart Symbols Chapter 1b Program Design Method Start/Stop (oval) The terminator symbol marks the starting or ending point of the system. It usually contains the word "Start" or "End." Action or Process (rectangle) A box can represent a single step ("add two cups of flour"), or and entire sub-process ("make bread") within a larger process.
  • 19. Flowchart Symbols Chapter 1 Program Design Method Decision (Diamond) A decision or branching point. Lines representing different decisions emerge from different points of the diamond. Input/Output (Parallelogram) Represents material or information entering or leaving the system, such as customer order (input) or a product (output).
  • 20. Flowchart Symbols Chapter 1 Program Design Method Flow Lines Lines indicate the sequence of steps and the direction of flow. On-Page Connector Indicates that the flow continues where a matching symbol (containing the same letter) has been placed in the same page.
  • 21. Flowchart Symbols Chapter 1 Program Design Method Off-Page Connector Indicates that the process continues on another page. Database / Disk Storage Input-Output Symbol Indicates input from or output to disk storage.
  • 22. Flowchart Example Chapter 1 Program Design Method
  • 23. Example What software use to draw flowchart? You can use Ms Word > AutoShapes> Flowchart or other flowchart drawing tools e.g: SmartDraw/Visio Drawing, Rational Rose,etc. Flowchart Chapter 1 Program Design Method
  • 24. Chapter 1 Program Design Method Pseudocode and Flowchart Convention 1. Sequence Structure  a series of steps or statements that are executed in order. begin Statement_1 Statement_2 … Statement_n end Statement 1 Statement 2 Statement..n
  • 25. Flowchart Example Chapter 1 Program Design Method Read x Read a y = 2x + a - 6 Display y Start End
  • 26. Chapter 1 Program Design Method Pseudo code and Flowchart Convention 2. Selection Structure  Define two courses of action depending on the outcome condition ( true or false)
  • 27. Flowchart Chapter 1 Program Design Method Pseudocode How to go to BP Mall ? 1. Begin 2. Do you have a car ? 3. If yes, drive your car towards BP Mall 4. Or else go by bus 5. Reach BP Mall 6. End
  • 28. Program Design Method 3 . Repetition Control Structures  Specifies a block of one or more statements that are repeatedly executed until a condition is satisfied . while condition loop-body end_while Pseudo code and Flowchart Convention
  • 29. start Set total to zero Set grade_counter to one While grade _ counter is less than or equal to ten input the next grade add the grade into the total add one to the grade_counter Set the class average to the total divided by ten Print the class average end Pseudocode Chapter 1 Program Design Method Flowchart How ?
  • 30. start read the amount_of_paint compute the total_price as price_per_tin times by amount_of paint display/print the result (or the total price ) end start read the student mark if mark is greater than 85 and mark is less than 100, then set grade as A display/print the grade end Try yourself! Convert to flowchar Convert to flowchart Chapter 1 Program Design Method
  • 31. A box has height, width and length. Write the pseudo code to calculate the volume of a box. Write the pseudo code to calculate salary of an employee for a month. Convert to Convert to flowchart Try yourself! Program Design Method
  • 32. Question Chapter 1 Program Design Method

Editor's Notes

  • #2: Prepared by : Hazalila Kamaludin, 2009/2010
  • #3: Prepared by : Hazalila Kamaludin, 2009/2010
  • #4: Prepared by : Hazalila Kamaludin, 2009/2010
  • #5: Prepared by : Hazalila Kamaludin, 2009/2010
  • #6: Prepared by : Hazalila Kamaludin, 2009/2010
  • #7: Prepared by : Hazalila Kamaludin, 2009/2010
  • #9: Prepared by : Hazalila Kamaludin, 2009/2010
  • #10: Prepared by : Hazalila Kamaludin, 2009/2010
  • #11: Prepared by : Hazalila Kamaludin, 2009/2010
  • #12: Prepared by : Hazalila Kamaludin, 2009/2010
  • #13: Prepared by : Hazalila Kamaludin, 2009/2010
  • #14: Prepared by : Hazalila Kamaludin, 2009/2010
  • #15: Prepared by : Hazalila Kamaludin, 2009/2010
  • #16: Prepared by : Hazalila Kamaludin, 2009/2010
  • #17: Prepared by : Hazalila Kamaludin, 2009/2010
  • #18: Prepared by : Hazalila Kamaludin, 2009/2010
  • #19: Prepared by : Hazalila Kamaludin, 2009/2010
  • #20: Prepared by : Hazalila Kamaludin, 2009/2010
  • #21: Prepared by : Hazalila Kamaludin, 2009/2010
  • #22: Prepared by : Hazalila Kamaludin, 2009/2010
  • #23: Prepared by : Hazalila Kamaludin, 2009/2010
  • #24: Prepared by : Hazalila Kamaludin, 2009/2010
  • #25: Prepared by : Hazalila Kamaludin, 2009/2010
  • #26: Prepared by : Hazalila Kamaludin, 2009/2010
  • #27: Prepared by : Hazalila Kamaludin, 2009/2010
  • #28: Prepared by : Hazalila Kamaludin, 2009/2010
  • #29: Prepared by : Hazalila Kamaludin, 2009/2010
  • #30: Prepared by : Hazalila Kamaludin, 2009/2010
  • #31: Prepared by : Hazalila Kamaludin, 2009/2010
  • #32: Prepared by : Hazalila Kamaludin, 2009/2010
  • #33: Prepared by : Hazalila Kamaludin, 2009/2010