problem solving process
problem solving process
This is a table with columns representing the input, output and processing activities required to
solve the problem.
Example: Write the steps to read a number, find its square and print the square of a number.
2. Identify Process: (read number, calculate the square, print the square)
[What must I do with the inputs to produce the desired output?]
IPO
sq num * num
Print sq
Example: Read a number, find its square and print the square of the number.
Initial Solution
Get the number, store the number in a variable called num
Square the number by multiply the number by itself
Place the result of the square into a variable called sq
Print sq
Important Terms:
Variable: The name given to a temporary storage location for data used in a program.
When a new value is placed into a variable, the previous value is replaced by the new
one.
Initialization of variables: Variables that are used as counters or used to store totals
should always be assigned an initial value of 0 before they are incremented.
Constant: Represents a memory location where a fixed item of data are stored. Eg VAT =
17.5%
Trace Tables:
A table in which you write the values of the variables in your algorithm. Test data are used to
check each statement of the algorithm to see if the algorithm is producing the correct results.
Dry Run
num sq Output
5 25 25
Important Terms:
Test Data: Dummy data used to check the logic and correctness of a program before end-
users operate it.
Live Data: Data previously processed by the system, that is used to check the logic and
correctness of a program before end-users operate it.