1.1. Analyzing Problems
Input, Process, and Output
🔹 Key Concepts
● Input: The raw materials or data required to solve a problem.
● Output: The final result or solution obtained after completing a task.
● Process: The series of steps or actions taken to convert the input into the output.
➤ The process should follow a correct order to achieve the desired result.
➤ Analyzing problems involves identifying input, process, and output separately.
Example: Preparing a Letter to Post
Problem:You need to prepare a letter that can be posted.
Component Description
Input Materials needed (paper, pen, envelope, stamp, glue)
Process 1. Write → 2. Fold & Insert → 3. Paste → 4. Address → 5. Stamp
Output Letter ready for posting
Alternative Solutions
Alternative Solutions: When more than one way exists to solve a given problem, each possible way is called an
alternative solution.
🔸 Key Points
> A problem can have multiple valid solutions.
> The choice between alternative solutions depends on:
➔ The nature of the problem
➔ Available resources
➔ Efficiency or convenience
➔ User preference
Nasrina ICT Notes - Grade 12 1
,Example Scenario: Getting to School if the Bus Breaks Down
✅ Problem: Your school bus breaks down on the way to school.
🔁 Alternative Solutions for the problem:
1. Take another school bus that goes to your school.
2. Use a CTB or private bus if you have money.
3. Walk to school along the usual road.
4. Walk to school using a shortcut.
5. Call your parents and ask for help.
6. Get a ride from a trustworthy person (car or motorbike).
💡 If it’s very important to attend school, you must evaluate the options and choose the most suitable one.
Best Solution: The most suitable choice among alternatives, depending on the situation.
🔹 What is a Solution Space?
● The set of all possible solutions to a problem is called the solution space.
● In this example, all six ways to reach school form the solution space.
● In computer programming, identifying the solution space helps in:
○ Picking the best or most efficient method.
○ Writing simpler and shorter programs.
🔹 What is an Algorithm?
● An algorithm is a step-by-step procedure used to solve a problem.
● It is like a plan or method that clearly describes each action needed to reach the final solution.
● Algorithms are used in daily life as well as in computer programming.
🔸 Why Do We Use Algorithms?
● To organize the steps clearly.
● To avoid missing any step.
● To make the process repeatable and understandable.
● To help in writing computer programs.
Nasrina ICT Notes - Grade 12 2
,Example 1: Algorithm to Post a Letter
✅ Problem: You want to post a letter.
🔁 Algorithm to post a letter:
1. Take a sheet of paper and a pen.
2. Write the letter.
3. Fold the letter.
4. Insert the letter into the envelope.
5. Paste the envelope using glue.
6. Write the recipient's address on the envelope.
7. Stick a stamp on the envelope.
8. Go to the post box or post office.
9. Drop the letter into the post box.
💡 Note: Steps like 6 and 7 can be interchanged, but the rest should follow this order for accuracy.
Control Structures in Algorithms
When creating algorithms, we use control structures to manage the flow of steps. There are three main types of
control structures:
Control Structure Description Example
Sequence Steps are executed in order Climbing stairs
Selection Choice depends on a condition Age check for school admission
Repetition Repeat steps until a condition is met Marking attendance in class
🔹 1. Sequence
When steps are executed one after the other in a fixed order, it is called a sequence.
Features of sequence:
➤ No conditions or loops
➤ Steps are followed from top to bottom
✅ Examples:
1. Climbing up or down stairs step by step.
2. A student starting from Grade 1 and continuing up to Grade 13.
Nasrina ICT Notes - Grade 12 3
, 🔸 2. Selection (Decision Making)
Selection is a control structure used in algorithms where a decision is made based on a condition. Depending on
whether the condition is true or false, the algorithm chooses one path and skips the others.
Features of selection:
a decision is made based on a condition. Depending on whether the condition is true or false, different steps are
followed.:
➤ Uses “if...else” or conditions
➤ Helps choose between two or more options
✅ Example:
1. Admitting a child to Grade 1
If the child is below 5 years as of 31st January:→ The child cannot be admitted to school
Else: → The child can be admitted to school
🔁 3. Repetition (Looping)
A step or group of steps are repeated until a condition is met. This is known as looping or repetition.
● Features of repetition:
➤ Useful for tasks that need to be repeated
➤ Uses “while”, “for”, or “repeat until” in programming
✅ Example:
1. Marking the attendance register.
Call the first student’s name
If present → mark 1
If absent → mark 0
Call the next student’s name
Repeat steps 2–4 until all names are called
Nasrina ICT Notes - Grade 12 4