Steps in Problem Solving: Define to Validate

Master the systematic approach to solving programming problems - a critical CSEC IT thinking skill!

1

The Problem-Solving Life Cycle

The Big Picture: Programming isn't the first step; it's the final result of a rigorous thinking process. Skipping the thinking leads to buggy, inefficient code.

The Five Essential Steps

  1. Define the Problem: What exactly needs to be solved?
  2. Propose and Evaluate Solutions: Brainstorm different approaches
  3. Determine the Most Efficient Solution: Choose the best approach
  4. Develop the Algorithm: Create step-by-step instructions
  5. Test and Validate the Solution: Ensure it works correctly
The Step Shuffler

Drag the steps into the correct chronological order!

Available Steps

?
Test and Validate the Solution
?
Define the Problem
?
Determine the Most Efficient Solution
?
Develop the Algorithm
?
Propose and Evaluate Solutions

Correct Sequence

2

Step 1: Defining the Problem (The IPO Chart)

Defining the Goal

If you don't know where you're going, you'll never get there. A clearly defined problem is half the solution.

The IPO Framework

  • Input: What data do we need to start with? (e.g., test scores, user name)
  • Process: What calculations or operations need to happen? (e.g., calculate average, validate input)
  • Output: What result should we produce? (e.g., final grade, welcome message)
IPO Investigator

Scenario: "A program to calculate the average of three test scores and determine if the student passed (average ≥ 50)."

Drag each variable into the correct IPO category!

Problem Scenario

Create a program that takes three test scores, calculates their average, and determines if the student passed (passing grade is 50 or higher).

Input

What goes IN

Process

What happens INSIDE

Output

What comes OUT

Test Score 1
Test Score 2
Test Score 3
Calculate Average
Compare to 50
Final Average
Pass/Fail Status
3

Step 2 & 3: Evaluating and Selecting Solutions

Brainstorming

Looking at different ways to solve the same problem. For example, finding the highest score in a list could be done manually or with a loop.

Criteria for "Best" Solution

  • Speed: How quickly does it execute?
  • Ease of Use: How understandable is the code?
  • Memory Requirements: How much storage does it need?
  • Scalability: Does it work with large datasets?
  • Maintainability: Is it easy to update later?
Solution Showdown

Problem: "Find the highest score in a list of 100 test results."

Which solution is more efficient based on the number of steps required?

Solution A: Manual Check

Manually compare each score:

  1. Look at score 1, remember it
  2. Look at score 2, compare to remembered
  3. Look at score 3, compare to remembered
  4. Repeat for all 100 scores...
  5. Report highest found
100 comparisons needed

Solution B: Smart Algorithm

Use a systematic approach:

  1. Assume first score is highest
  2. Check next score: if higher, update
  3. Check next score: if higher, update
  4. Repeat until all checked
  5. Report final highest
99 comparisons needed
4

Step 4 & 5: Development and Validation

From Idea to Logic

Converting mental plans into structured formats:

  • Pseudocode: English-like description of steps
  • Flowcharts: Visual diagrams showing logic flow
  • Algorithms: Step-by-step procedures

Validation & Testing

Ensuring the solution works using different test data types:

  • Normal Data: Typical, expected inputs
  • Boundary Data: Edge cases and limits
  • Erroneous Data: Invalid or unexpected inputs
The Bug Catcher

This algorithm calculates a student's grade based on their score. Find and click on the bug!

START
INPUT studentScore
IF studentScore ≥ 90 THEN grade = "A"
ELSE IF studentScore ≥ 80 THEN grade = "B"
ELSE IF studentScore ≥ 70 THEN grade = "C"
ELSE grade = "F"
OUTPUT grade
END
🐛

Test the algorithm with this data:

Test Case Input (Score) Expected Output Actual Output Status
Normal 85 B ?
Boundary 70 C ?
Boundary 90 A ?
Erroneous 105 Error/Invalid ?

Scroll to Top