COS 102 — Module 2
Understanding Problem Identification and Analysis
Date: 5/3/2025
What is Problem Identification?
Problem identification is the process of:
• Clearly defining what needs to be solved
• Understanding the goal
• Understanding the context
Before coding, ask:
• What exactly is the problem?
• What result is expected?
Sample — School Result System
Problem: Develop a system to calculate student grades.
Questions to clarify:
• What scores are needed?
• What grading scale will be used?
• Should records be stored?
Clear definition prevents confusion later.
Problem Decomposition
Large problems become easier to solve when broken into smaller parts.
Decomposition: Breaking a complex problem into manageable sub-problems.
Benefits:
• Simplifies design
• Easier debugging
• Better organization
Example of Decomposition:
Build an online shopping system. Break into:
• User registration
• Product display
• Payment processing
• Order tracking
Each part can be developed separately.
Requirements Gathering
Requirements describe what the system must do.
Two Types:
1. Functional Requirements — What the system should do; it focuses on actions/features.
2. Non-Functional Requirements — How the system should perform.
Functional vs Non-Functional:
Functional:
• Calculate average score
• Display result
Non-Functional (focuses on features/quality):
• Respond within 2 seconds
• Be secure
• Be user friendly
Understanding Constraints
Constraints are limitations placed on the solution.
Examples:
• Time limit
• Memory limitations
• Budget restrictions
• Legal rules
Constraints influence how we design solutions.
Identifying Inputs and Outputs
Every computing problem has inputs and outputs.
Inputs → Data given to the system.
Examples:
• Numbers
• Texts
• Dates
Outputs — Results produced.
Examples:
• Calculated grades
• Sorted list
• Confirmation message
Example — ATM System
Problem: Withdraw money
Inputs:
• Account number
• PIN
• Amount
Algorithm
Outputs:
• Cash
• Updated balance
Constraints:
• Cannot withdraw more than available balance.
Why Analysis is Important
Proper analysis:
• Reduces coding errors
• Saves development time
• Improves solution quality
• Makes algorithm design easier
Good programmers think before coding.
Common Mistakes Students Make
• Jumping straight into coding
• Ignoring constraints
• Making assumptions
• Not clarifying requirements
Key Takeaways
• Clear problem identification is essential.
• Decomposition simplifies complex problems.