SlideShare una empresa de Scribd logo
1 de 32
Universiti Tun Hussien Onn Malaysia Faculty of Mechanical and Manufacturing Engineering
Scenarios in real life ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Program Design Method
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],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 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],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 ,[object Object],[object Object],[object Object],[object Object],[object Object],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 ,[object Object],[object Object],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 ,[object Object],[object Object],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 ,[object Object],[object Object],[object Object]
Flowchart Chapter 1 Program Design Method Pseudocode ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Program Design Method ,[object Object],[object Object],[object Object],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

Más contenido relacionado

La actualidad más candente

Algorithms and flowcharts ppt (seminar presentation)..
 Algorithms and flowcharts  ppt (seminar presentation).. Algorithms and flowcharts  ppt (seminar presentation)..
Algorithms and flowcharts ppt (seminar presentation)..
Nagendra N
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
khair20
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
luhkahreth
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
rajnidhiman
 
8.1 alogorithm & prolem solving
8.1 alogorithm & prolem solving8.1 alogorithm & prolem solving
8.1 alogorithm & prolem solving
Khan Yousafzai
 

La actualidad más candente (20)

3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
 
Algorithms and flowcharts ppt (seminar presentation)..
 Algorithms and flowcharts  ppt (seminar presentation).. Algorithms and flowcharts  ppt (seminar presentation)..
Algorithms and flowcharts ppt (seminar presentation)..
 
Flowchart and algorithm
Flowchart and algorithmFlowchart and algorithm
Flowchart and algorithm
 
algo
algoalgo
algo
 
Flowchart and algorithem
Flowchart and algorithemFlowchart and algorithem
Flowchart and algorithem
 
Algorithms and flowcharts by Haseeb Khan
Algorithms and flowcharts by Haseeb KhanAlgorithms and flowcharts by Haseeb Khan
Algorithms and flowcharts by Haseeb Khan
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Algorithm & flow chart
Algorithm & flow chartAlgorithm & flow chart
Algorithm & flow chart
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Algorithms and how to write an algorithms
Algorithms and how to write an algorithmsAlgorithms and how to write an algorithms
Algorithms and how to write an algorithms
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Introduction to Algorithms & flow charts
Introduction to Algorithms & flow chartsIntroduction to Algorithms & flow charts
Introduction to Algorithms & flow charts
 
8.1 alogorithm & prolem solving
8.1 alogorithm & prolem solving8.1 alogorithm & prolem solving
8.1 alogorithm & prolem solving
 
Program design techniques
Program design techniquesProgram design techniques
Program design techniques
 
Best Techniques To Design Programs - Program Designing Techniques
Best Techniques To Design Programs - Program Designing TechniquesBest Techniques To Design Programs - Program Designing Techniques
Best Techniques To Design Programs - Program Designing Techniques
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Unit 3 Foc
Unit  3 FocUnit  3 Foc
Unit 3 Foc
 
Writing algorithms
Writing algorithmsWriting algorithms
Writing algorithms
 

Destacado

Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
alish sha
 
Bahan kuiz p2 27 march
Bahan kuiz p2 27 marchBahan kuiz p2 27 march
Bahan kuiz p2 27 march
nm170209
 
Books to Read
Books to ReadBooks to Read
Books to Read
nplisko
 
Ways of looking 2
Ways of looking 2Ways of looking 2
Ways of looking 2
amandakane1
 
Attn list test
Attn list testAttn list test
Attn list test
alish sha
 
Bti1022 lab sheet 7
Bti1022 lab sheet 7Bti1022 lab sheet 7
Bti1022 lab sheet 7
alish sha
 

Destacado (20)

Management information system mordern perspective
Management information system mordern perspectiveManagement information system mordern perspective
Management information system mordern perspective
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Bahan kuiz p2 27 march
Bahan kuiz p2 27 marchBahan kuiz p2 27 march
Bahan kuiz p2 27 march
 
Presentation2
Presentation2Presentation2
Presentation2
 
Books to Read
Books to ReadBooks to Read
Books to Read
 
Ways of looking 2
Ways of looking 2Ways of looking 2
Ways of looking 2
 
Attn list test
Attn list testAttn list test
Attn list test
 
Roda + Fields Business System Presentation 041511 Copy
Roda + Fields Business System Presentation 041511 CopyRoda + Fields Business System Presentation 041511 Copy
Roda + Fields Business System Presentation 041511 Copy
 
تأثير تقنية الاتصال الشخصي على الشباب
تأثير تقنية الاتصال الشخصي على الشبابتأثير تقنية الاتصال الشخصي على الشباب
تأثير تقنية الاتصال الشخصي على الشباب
 
Materiales
MaterialesMateriales
Materiales
 
TiemTapHoa
TiemTapHoaTiemTapHoa
TiemTapHoa
 
Bti1022 lab sheet 7
Bti1022 lab sheet 7Bti1022 lab sheet 7
Bti1022 lab sheet 7
 
Let's Enjoy Our Vacation
Let's Enjoy Our VacationLet's Enjoy Our Vacation
Let's Enjoy Our Vacation
 
3 keuzes
3 keuzes3 keuzes
3 keuzes
 
WLC AAR
WLC AARWLC AAR
WLC AAR
 
Rediscover india
Rediscover indiaRediscover india
Rediscover india
 
Literary Terms
Literary Terms Literary Terms
Literary Terms
 
الأسبوع السابع
الأسبوع السابعالأسبوع السابع
الأسبوع السابع
 
تعليمات السلامة
تعليمات السلامةتعليمات السلامة
تعليمات السلامة
 
Tema 2 cmc
Tema 2 cmcTema 2 cmc
Tema 2 cmc
 

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

Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchart
lotlot
 
Ch1 principles of software development
Ch1 principles of software developmentCh1 principles of software development
Ch1 principles of software development
Hattori Sidek
 
L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdf
MMRF2
 

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

Chap3
Chap3Chap3
Chap3
 
Chapter 2- Prog101.ppt
Chapter 2- Prog101.pptChapter 2- Prog101.ppt
Chapter 2- Prog101.ppt
 
Class 7 lecture notes
Class 7 lecture notesClass 7 lecture notes
Class 7 lecture notes
 
AlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdfAlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdf
 
Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchart
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowcharts
 
Software develop....
Software develop.... Software develop....
Software develop....
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
 
Class 8 Lecture Notes
Class 8 Lecture NotesClass 8 Lecture Notes
Class 8 Lecture Notes
 
learn computer science.ppt
learn computer science.pptlearn computer science.ppt
learn computer science.ppt
 
Ch1 principles of software development
Ch1 principles of software developmentCh1 principles of software development
Ch1 principles of software development
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
ALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdfALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdf
 
Algorithms and Flowchart.ppt
Algorithms and Flowchart.pptAlgorithms and Flowchart.ppt
Algorithms and Flowchart.ppt
 
L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdf
 
2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptx2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptx
 
MPP-UPNVJ
MPP-UPNVJMPP-UPNVJ
MPP-UPNVJ
 
lecture 5
 lecture 5 lecture 5
lecture 5
 

Más de alish sha

Más de alish sha (20)

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

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

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

  • 1. Universiti Tun Hussien Onn Malaysia Faculty of Mechanical and Manufacturing Engineering
  • 2.
  • 3.
  • 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.
  • 7.
  • 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.
  • 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.
  • 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.
  • 25. Flowchart Example Chapter 1 Program Design Method Read x Read a y = 2x + a - 6 Display y Start End
  • 26.
  • 27.
  • 28.
  • 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

Notas del editor

  1. Prepared by : Hazalila Kamaludin, 2009/2010
  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
  8. 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