Jannatul Ferdous Ruma
Lecturer, Department of CSE
University of Liberal Arts Bangladesh (ULAB)
Introduction to
Programming
2
Overview
• Simple program development
• Pseudocode statements
• Flowchart symbols
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)
● Pseudocode 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
o Indicates input operation
o Parallelogram
9
Using Flowchart Symbols
• Processing symbol
o Processing statements such as
arithmetic
o Rectangle
10
Using Flowchart Symbols
• Output symbol
o Represents output statements
o 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
13
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
14
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
Complete the flowchart.
Flowchart: Find the average of three numbers
Pseudocode
Flowchart

Introduction to Programming Lecture Material 2