CHapter 10
CHapter 10
CHapter 10
PROBLEM
SOLVING AND
PROGRAM DESIGN
PROBLEM
• Problem
• Develop an idea, make a program to solve
problem?????
• Solution
5 STEPS IN PROBLEM SOLVING
• All Algorithm
1.Have a set of steps
2.Are precise
3.Are unambiguous
4.Have instructions that flow
5.Eventually terminate
IPO CHART
Input Processing Output
ALL the
What is given instructions The
that must be expected
executed to results
transform
what is given
into the
expected
results.
GRADED ASSIGNMENT (PPT, BRISTOL
BOARD)
1.Represent a real life example using an IPO chart.
2.Construct an Algorithm and represent in an IPO
chart.
3.What is pseudocode, ways of presenting
pseudocode. Give example.
4.what is flow chart, correct use of it, give
example.
CLASSWORK
PROBLEMS WITH SUM
1.Find the sum of three numbers.
INPUT PROCESSING
OUTPUT
START STORE (Num 1 +Num 2+ Num3)
SUM
INPUT Num 1 TO SUM
END
INPUT Num 2
INPUT Num 3
EXAMPLE IN REAL LIFE
Margarine
Given the price and taxes paid for an item. Calculate
the taxes to be paid and total price to be paid with
tax.
PROBLEM SOLVING: USE AN IPO CHART
• All Algorithm
1.Have a set of steps
2.Are precise
3.Are unambiguous
4.Have instructions that flow
5.Eventually terminate
Representing Algorithm
An Algorithm may be represented in one of two ways: by
using FLOWCHARTS OR PSEUDOCODE.
TERMINAL
DECIISION INPUT/
PROCESS OUTPUT
Symbols Meaning
Yes No
Mark >60
IF(>=60) THEN
WRITE ( You have pass)
END You have pass
END
Representation
IF….THEN….ESLE
PSEUDOCODE FLOWCHART
TRUE FALSE
Mark >=60
IF(score>=60) THEN
PRINT ( Julian Cho)
ELSE Well done Try harder
PRINT (NEED TO TRY HARDER)
ENDIF
END
FLOWCHART
ADDING TWO NUMBERS USING A FLOWcHART
PRACTISE
END
AVERAGE
FIND THE AVERAGE OF THREE NUMBERS
AVERAGE EXERCISE