SECTION D – PROBLEM SOLVING AND PROGRAM DESIGN

Problem solving:
You are required to:
1. Develop an algorithm in either pseudocode or flowchart that will accept the names and
rank of at least five (5) staff members and their total sales for the month. The algorithm
must calculate the commission at 3% of their total sales amount. It should also display the
name, total sales, and commission of all the employees. It should also output the person
with the highest commission.

n=0

max = 0
loop {
n++
read name(n),rank(n),sales(n)
if name = "" then if n >= 5 then exit loop
else {print "More names needed"; repeat loop}
comm(n) = sales(n) * 0.03
max = n if comm(n) > max
}
n--
for i = 1..n {
print name(n),rank(n),sales(n)
}
if max > 0 then print "name(max) had the highest commission"
else print "No one had any sales!"