Page 84 - Code & Click - 4
P. 84
DECISION MAKING AND REPETITION OF STEPS
Some problems involve situations where we have to decide
about a course of action to follow to solve the problem. This
process is called Decision making. Yes No
Example 2: You need to make a call to your friend and talk to him. Condition?
Step 1: Get the phone number of the friend you want to talk to.
Step 2: Dial the number on the phone.
Step 3: When the call is picked up, inquire who the other person is.
Step 4: If the person is your friend, talk to him and go to Step 6, else
Step 5: Ask for your friend. When he comes to the phone, talk to him.
Step 6: End the call.
In the above example, Step 3 presented two situations. Depending on the person who
picked the call, we either follow Step 4 or Step 5. Thus, we made a decision based on
the situation to follow one of the two courses of action available.
Some problems have a solution where we need to repeat
certain steps to solve the problem. Carrying out a step or group
of steps more than once is called Repetition of steps or Loop.
Example 3: Your school carried out a charity drive to collect
funds for the elderly and homeless people. You need to
calculate the total amount collected by the students of your
class and report it to the class teacher. No Decision? Yes
Step 1: Obtain the list of students who participated in the
charity drive.
Step 2: Obtain the amount collected by the student.
Step 3: Add the amount collected to the previous amount. (The initial sum is zero)
Step 4: If there are more students left in the list, repeat Steps 2 and 3, else
Step 5: Report the amount to the class teacher.
Here, Steps 2 and 3 will be repeated for every student till all students in the list are not
finished.
Post-Processingost-Processing
P
The process of devising a solution to a problem is called Problem Solving.
Logical thinking is the ability to understand a given problem and develop a series of
steps to solve it.
Reasoning is the ability to analyse and choose the best solution among several
possible solutions.
The process of developing the steps to solve a problem is called Stepwise Thinking.
Decision making and Repetition of steps are integral parts of Stepwise thinking.
82