Jannatul Ferdous Ruma Lecturer, Department of CSE University of Liberal Arts Bangladesh (ULAB) Introduction to Programming
Overview Simple program development Pseudocode statements Flowchart symbols 2
Understanding the Program Development Cycle Program development cycle (do not memorise ) Understand the problem Plan the logic Code the program Use software (a compiler) to translate the program into machine language Execute/run the program 3
Understanding the Program Development Cycle (continued) 4
Using Pseudocode Statements and Flowchart Symbols When we solve a problem there are some logical steps that we follow Pseudocode English-like representation of those logical steps Flowchart Pictorial representation of those logical steps 5
Writing Pseudocode Pseudocode representation of a number-doubling problem start input myNumber set myAnswer = myNumber * 2 output myAnswer stop 6
Writing Pseudocode (continued) P seudocode begins with a statement start and ends with a terminating statement stop Flexible because it is a planning tool 7
8 Using Flowchart Symbols Input symbol Indicates input operation Parallelogram
9 Using Flowchart Symbols Processing symbol Processing statements such as arithmetic Rectangle
10 Using Flowchart Symbols Output symbol Represents output statements Parallelogram
Drawing Flowcharts (continued) Flowlines Arrows that connect steps Terminal symbols Start/stop symbols Shaped like a racetrack 11
Flowchart Symbols and Pseudocode Statements Flowchart and pseudocode of program that doubles a number
Flowchart: Adding Two Numbers Pseudocode Step 1 : Start Step 2 : Input first number A Step 3 : Input second number B Step 4 : Add the two numbers and store it in total Step 5 : Print Total Step 6 : Stop 13
Flowchart: Calculating area of a square Pseudocode Step 1 : Start Step 2 : Read value for a (side) Step 3 : [Compute] Area = A * A Step 4 : Output Area Step 5 : Stop 14 Complete the flowchart.
Flowchart: Find the average of three numbers Pseudocode Flowchart