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
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.
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
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