www.lmu.edu.
ng
COS 102
Flowchart
Lecture Note 5
Lecturer:
ASS. PROF O. N. AKANDE
Akande Noah O. (Ph. D.)
Flowcharts
▪ Flowcharts are graphical representations of algorithms
▪ They use symbols to represent actions, decisions,
inputs, outputs, and the flow of control in a program.
▪ Flowcharts help programmers visualize and plan the
logical flow of a program before coding.
▪ They are particularly useful for understanding complex
algorithms and for communication between team
members
2
Flowchart Symbols
▪
START / STOP
INPUT/ OUTPUT
3
Flowchart Symbols
▪
PROCESS / OPERATION
DECISION
4
Flowchart Symbols
▪
FLOW LINES
PAGE CONNECTOR
5
Finding the Average of 3 Numbers
▪ START
▪ READ a, b, c
▪ SET sum = a + b + c
▪ SET avg = sum / 3
▪ OUTPUT avg
▪ END
6
Flowchart
▪ START
▪ READ a, b, c
▪ SET sum = a + b + c
▪ SET avg = sum / 3
▪ OUTPUT avg
▪ END
▪
7
Flowchart
▪ Draw a flowchart
for adding
integers from 1 to
100 (1 and 100
inclusive); then
print the sum
8
Flowchart
▪ ABC Transports plans to give a 6% year-end bonus
to each of its employees earning $6,000 or more
per month, and a fixed $250 bonus to the remaining
employees. Draw a flowchart for calculating the
bonus for an employee
9
Flowchart
▪ ABC Transports plans
to give a 6% year-end
bonus to each of its
employees earning
$6,000 or more per
month, and a fixed
$250 bonus to the
remaining employees.
Draw a flowchart for
calculating the bonus
for an employee
10
Flowchart
▪ ABC Transports plans
to give a 6% year-end
bonus to each of its
employees earning
$6,000 or more per
month, and a fixed
$250 bonus to the
remaining employees.
Draw a flowchart for
calculating the bonus
for an employee
11
Flowchart
▪ Draw a flowchart to calculate the simple interest
using the formula:
P∗T∗ R
▪ Simple interest =
100
▪ Where P is Principal Amount, T is the period and R
is the rate of interest
12
Flowchart Drawing Tools
▪ The following tools can be used to draw flowcharts:
▪ Online Tools
▪ EDRAW: https://www.edrawmax.com/online/
▪ Creately: https://creately.com/
▪ Standalone Tools
– Microsoft Visio
13
Assignment 1
▪ Scenario: Shipping Cost Calculation
▪ An online store charges shipping costs based on the weight of the
package:
▪ - Package weight < 1 kg: $5 shipping cost
▪ - Package weight between 1 kg and 3 kg: $10 shipping cost
▪ - Package weight > 3 kg: $15 shipping cost + $2 for each
additional kg over 3 kg
▪ Write an algorithm or Pseudocode to calculate the shipping cost
based on the package weight.
▪ Also draw the corresponding flowchart of your solution.
14
Assignment 2: Scenario: Product Inventory Management
▪ A store manager wants to calculate the total value of all products in the
inventory. The inventory contains multiple products, each with a quantity and
price.
▪ Requirements
▪ - Input: Number of products, quantity, and price for each product
▪ - Output: Total value of all products in the inventory
▪ Calculation
▪ - For each product, multiply the quantity by the price to get the product value
▪ - Add up the product values to get the total inventory value
▪ Write an algorithm or Pseudocode to calculate the total value of all products in
the inventory.
▪ Also draw the corresponding flowchart of your solution.
15
Assignment 3
▪ Scenario: Student Grade Calculation
▪ A teacher wants to calculate the average grade of a class of students. The
teacher has a list of students with their respective grades.
▪ Requirements
▪ - Input: Number of students, grade for each student
▪ - Output: Average grade of the class
▪ Calculation
▪ - Add up all the grades
▪ - Divide the sum by the number of students
▪ Write an algorithm or Pseudocode to calculate the average grade. Also draw the
corresponding flowchart of your solution
16
Assignment 4: Sales Commission Calculation
▪ A sales manager wants to calculate the total commission earned by a
salesperson for a month. The salesperson has a list of sales transactions with the
sale amount for each transaction.
▪ Requirements
▪ - Input: Number of sales transactions, sale amount for each transaction
▪ - Output: Total commission earned
▪ Calculation
▪ - For each transaction, calculate the commission (e.g., 10% of sale amount)
▪ - Add up the commissions for all transactions
▪ Write an algorithm or Pseudocode to calculate the total commission earned by
a salesperson for a month. Also draw the corresponding flowchart of your
solution
17