CSS Computer Science (Optional) — Paper-I, Section-A, Topic II subtopic. Precedes actual coding in the problem-solving lifecycle.
Steps to Define a Problem Systematically
- Problem statement — state clearly and precisely what needs to be solved
- Requirements analysis — identify what inputs are available and what outputs are expected
- Constraints identification — note any limits (time, memory, valid input ranges)
- Decomposition — break the problem into smaller, manageable sub-problems
- Identify inputs/outputs (I/O) explicitly — define data types and formats
- Design the solution — using algorithms, flowcharts, or pseudocode
- Verify against test cases — before implementation, mentally trace through sample inputs
Why This Step Matters
- A poorly defined problem leads to a program that technically "works" but solves the wrong problem
- Systematic definition reduces backtracking during coding and debugging
- Forms the basis of the full Program Development Life Cycle: Define → Design → Code → Test → Debug → Maintain
Worked Example
Problem (as given): "Write a program to process student marks." This is too vague to code directly. Applying the steps:
- Problem statement: Compute the average of a student's marks in N subjects and assign a grade.
- Requirements analysis: Input = number of subjects N and N marks (0–100 each); Output = average marks and a letter grade.
- Constraints: N must be a positive integer; each mark must be in the range 0–100.
- Decomposition: Sub-problems = (a) read marks, (b) compute average, (c) map average to a grade, (d) display result.
- I/O definition: Input — integer N, then N floating-point marks; Output — one float (average) and one character/string (grade).