CSC 101 - Problem Solving
CSC 101 - Problem Solving
Computational-
Problem Solving
Process
PROBLEM SOLVING USING
ALGORITHMS AND FLOWCHARTS
A computer is only a problem-solving tool!
(one of the many different tools engineers and
computer scientists use in solving problems).
Sol.:
Begin
input name, hours-worked, and wage/hour
Calculate gross-pay = hours-worked * wage/hour
End
EXAMPLE 2
Sol.:
Begin
input name, mark
New-mark = mark + 5
End
EXAMPLE 3
Write an algorithm to read the name and marks
of 10 students and calculate the new mark of
each by adding 5 to their marks.
Sol.:
Begin 1
student-count = 1 2
if student-count > 10 then Stop 3
else 4
read (input) name, mark 5
calculate new-mark = mark + 5 6
print name, new-mark 7
student-count = student-count + 1 8
goto step 3 9
End 10
FLOWCHARTS
A graphical tool that diagrammatically depicts the
steps and structure of an algorithm or program
I. O. Akinyemi (2017)
2. Consider Example 4, assume 100 Level result
is required for your Department:
write an appropriate Algorithm and