Lab 2: Problem Solving Using Algorithm: Pseudocode
Lab 2: Problem Solving Using Algorithm: Pseudocode
Objectives:
Pseudocode
A sequence of activities to be processed for getting desired output from a given input
Before writing a pseudocode for a problem, one should find out what is/are the inputs and
what is/are expected output
It uses short terms or simple English
While writing pseudocode we will use following symbol for different operations:
example pseudocode
Pseudocode:
Start
1. Read/input/get the Radius r of the Circle
2. Area 3.14*r*r
3. Display Area
End
Flowchart
A type of diagram that represents a workflow or process
A flowchart can also be defined as a diagrammatic representation of an algorithm, a step-by-
step approach to solving a task
Common flowchart symbols:
Example flowchart
Start
Read r
Area = 3.14*r*r
Display Area
End
Exercises
Task 1: Write the pseudocode and design the flowchart to read two numbers and find their sum
Task 2: Write the pseudocode and design the flowchart to convert Fahrenheit to Celsius
Task 3: Write pseudocode and design the flowchart to find the greater number between two numbers
Task 4: Write pseudocode and design the flowchart that display the area of a rectangle by accepting
length and width from the user.
Task 5: Write pseudocode and design the flowchart to find the largest value of any three numbers