Flowchart Basics For Beginners-1
Flowchart Basics For Beginners-1
Flowchart Basics For Beginners-1
What is a computer?
A computer is an electronic device capable of accepting data, processing it, giving
it out and storing it for future use.
Taking into consideration the above definition, all computers regardless of their
difference in size, capacity, speed, cost and number of users, have to perform four
basic functions. These are:
Acceptance of data
Processing of data
Giving out processed data and
Storing data
Basic Elements of a computer
Data Storage
Input Devices
Input devices send data and instructions to the computers. There are so many input
devises the most common ones are Keyboard, Mouse, Trackball, Scanner, Light
pen, Touch screen, Modem, Joystick, Microphone, Bar code reader, Digital
camera, Video digitizer.
Output Devices
These are devices that display or output work which has been done by the
computer in a form readable to the users. These include the following
Monitor (VDU or SCREEN), Printer, Plotters, Actuators, Speakers
Page 1 of 10
ALGORITHM
Algorithm can be defined as: “A sequence of activities to be processed for getting
desired output from a given input.”
Webopedia defines an algorithm as: “A formula or set of steps for solving a
particular problem. To be an algorithm, a set of rules must be unambiguous and
Before writing an algorithm for a problem, one should find out what is/are the
inputs to the algorithm and what is/are expected output after running the algorithm.
Now let us take some exercises to develop an algorithm for some simple problems:
While writing algorithms we will use following symbol for different operations:
Algorithms were originally developed as part of mathematics but now the word is
intensely used in computer science. Algorithms are used for calculation, data
processing, and many other fields.
SIGN MEANING
+ Addition
− Subtraction
∗ Multiplication
/ Division
^ power
= Equal to
< Less than
> Greater than
<= less than or equal to
>= greater than or equal to
<> for is not equal to
% percentage
Page 2 of 10
Type of Algorithms
The algorithm and flowchart, classification to the three types of control structures.
They are:
Sequence
Branching (Selection)
Loop (Repetition)
Algorithm:
Step1: Read /input/enter the Radius r of the Circle
Step2: if radius < 0 then print invalid radius go to step 1
Step3: Area = π ∗r∗r
Step4: Print Area
Step5: end
Problem 2
Algorithm to find the sum of two numbers
Inputs to the algorithm:
First num1.
Second num2.
Expected output:
Sum of the two numbers.
Algorithm:
Step1: Start
Step2: Read/input the first num1.
Step3: Read/input the second num2.
Step4: Sum ← num1+num2 // calculation of sum
Step5: Print Sum
Step6: End
Page 3 of 10
FLOWCHART
What is a flowchart?
A flowchart is a picture (graphical representation) of the problem solving
process.
A flowchart gives a step-by-step procedure for solution of a problem.
A flowchart is a diagram which visually presents the flow of data through
processing systems.
A flow is a systematic way of presenting the flow of a computer process
using symbols.
Elements of a flowchart:
Various geometrical shaped boxes represent the steps of the solution.
The boxes are connected by directional arrows to show the flow of the
solution.
Uses of a flowchart:
To specify the method of solving a problem.
To plan the sequence of a computer program.
Communicate ideas, solutions.
Basic FlowChart Symbols
Page 4 of 10
Rectangle
Denotes a process to be carried out e.g.
addition, subtraction, division etc.
Statement block − A statement to execute,
or a behavior to perform.
Formulas are put here
Key words used
Calculate
evaluate
solve
compute
calculate
add
sum
multiply
Display
Parallelogram
Denotes an input/output operation
Key words used
Input
Output
Enter
Print
Read
Display
Flow Arrows Arrows are used to connect the steps in a
(Arrow lines ) flow chart, to show the flow or sequence
of the problem solving process.
Plus sign + +
Minus sign − −
Page 5 of 10
How to read a flowchart
Identify input and move downwards following the arrow down to the output.
Move from step to step in the chart by following the lines between them. Perform
any action or calculation listed when you reach a Statement Block (rectangle), and
then when you reach a Decision Block (diamond) check if the condition is met and
choose the appropriate path.
Page 6 of 10
Guidelines on drawing a flowchart
Now, we will discuss some examples on flowcharting. These examples will help in
proper understanding of flowcharting technique.
Solution:
Page 7 of 10
Problem 2: Convert temperature Fahrenheit to Celsius.
Solution:
The first thing to note here is that converting temperature in Fahrenheit to Celsius
5
is given by the formula C = (𝐹 − 32)
9
5
So from C = (𝐹 − 32), we have C = 5⁄9 ∗ (𝐹 − 32)
9
Task
1. Draw a flow chart on how to find the sum of two numbers.
2. Draw a flow chart on how to find loss or profit
Page 8 of 10
Expected Answers for the Task
Question 1
Start
Read A
Read B
Sum = A + B
Print Sum
Stop
Page 9 of 10
Question 2
Start
Is Yes
SP < CP Profit = SP −CP
No
Loss = CP − SP
Print Profit
Print loss
Stop
Page 10 of 10