Six original Cambridge-style questions on abstraction and decomposition, with mark-scheme style answers.
Describe the purpose of abstraction when designing a solution to a problem.
State three benefits of using abstraction.
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.
Explain how decomposition leads to the use of procedures and functions in a program.
A team is writing a payroll program. Give three advantages of decomposing the program into modules.
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.
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.