AS · Practice questions · Abstraction and decomposition

Simplify, then split.

Six original Cambridge-style questions on abstraction and decomposition, with mark-scheme style answers.

Original questions All questions on this page are original work, written in the Cambridge AS & A Level style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

Remove, then divide.

01
Explain
[2 marks]

Describe the purpose of abstraction when designing a solution to a problem.

  • Removing / filtering out details that are not relevant to the problem. ✓
  • To produce a simplified (abstract) model that keeps only the essential details. ✓
02
Recall
[3 marks]

State three benefits of using abstraction.

  • The problem is less complex / easier to understand. ✓
  • The solution is quicker to design and program (less development time). ✓
  • Less data needs to be collected and stored / the program is smaller; the model may be reused (any one). ✓
03
Apply
[4 marks]

A cinema wants a program to sell seats online. Produce an abstract model of a seat for this program by identifying three essential details. Give one detail that should be left out and justify your choice.

  • Seat identifier, e.g. row letter and seat number. ✓
  • Whether the seat is booked or available (for the chosen showing). ✓
  • Price band / seat type (e.g. standard, premium, wheelchair space). ✓
  • Left out: e.g. colour of the seat fabric, because it does not affect booking or pricing. ✓
04
Explain
[2 marks]

Explain how decomposition leads to the use of procedures and functions in a program.

  • The problem is broken down into smaller sub-problems (repeatedly). ✓
  • Each sub-problem is small enough to be coded as one module: a procedure or a function. ✓
05
Analysis
[3 marks]

A team is writing a payroll program. Give three advantages of decomposing the program into modules.

  • Modules can be written by different programmers at the same time. ✓
  • Each module can be tested on its own, so errors are easier to find and fix. ✓
  • Modules can be reused (called many times or in other programs), so code is not repeated; maintenance is easier. ✓
06
Write
[4 marks]

Write pseudocode for a function Larger that takes two integer parameters and returns the larger of the two. Then write a statement that uses the function to output the larger of Score1 and Score2.

  • Header FUNCTION Larger(A : INTEGER, B : INTEGER) RETURNS INTEGER. ✓
  • IF A > B THEN RETURN A ELSE RETURN B ENDIF (or equivalent; either value if equal). ✓
  • ENDFUNCTION. ✓
  • OUTPUT Larger(Score1, Score2) (no CALL, used in an expression). ✓

Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.