Skip to study material
← Question index

QUESTION 03 · Program development

List any four stages of program development.

2 marks

Answer

Four stages are problem analysis, solution design, implementation and testing.

  • Analysis identifies the input, output and limits; design plans the steps.
  • Coding writes the code; testing compares actual output with expected results.

QUESTION 04 · Program development

Explain the stages of program development with an example.

5 marks

Answer in brief

Program development is the process of understanding a problem, planning its solution, writing the program, testing it and maintaining it.

Stages of program development

  1. Problem analysis: Understand what the program must do. Identify the inputs, outputs and limits on the input values.
  2. Solution design: Prepare an algorithm, pseudocode or flowchart. Choose the steps needed to solve the problem.
  3. Coding: Write the planned solution in a programming language such as C. Use suitable variables, operators and statements.
  4. Compilation: Translate the source program. Read the compiler messages and correct syntax mistakes.
  5. Testing and debugging: Run the program with different inputs. Compare its output with the expected result. Find and correct the causes of wrong results.
  6. Documentation and maintenance: Write useful notes about the program. Update it when requirements change or a mistake is found.

Example: average of three marks

Inputs: three marks. Output: their average. First add the marks, then divide the total by 3.0. In C, using 3.0 allows a fractional result when the total is an integer. For marks 60, 75 and 90, the total is 225 and the average is 75.

Testing

Try ordinary values, boundary values and invalid values. If marks must be between 0 and 100, the program should check that rule. Testing finds a failure; debugging finds and fixes its cause. If a change introduces another mistake, test the corrected program again. Successful compilation alone does not prove that the answer is correct.

Reference table

↔ Scroll horizontally on a small screen
Tests for an average-of-three program
CaseInputExpected behaviour
Normal60, 75, 90Average = 75.0
Boundary0, 0, 0Average = 0.0
Fractional result1, 2, 2Approximately 1.6667, not 1
InvalidA mark outside the agreed rangeReject according to the stated requirement.

Diagram or flowchart

Requirements lead to design, implementation, testing and maintenance; failed tests return to implementation.
Program development cycle · Download diagram

Key points

  • State requirements before choosing code.
  • Include boundary tests and an expected result.