Revision Library
Choose a subject
Menu
Computer Science
Need a new topic?
Missing a topic, found a bug, or want something added?

Component 2: Algorithms and Programming A Level Computer Science Worksheets, Questions and Revision

9 original Component 2: Algorithms and Programming worksheet packs - 118 printable pages with full mark schemes. Computational thinking, algorithms, programming paradigms and data structures. View any pack in the browser or open the print-ready PDF.

OCR H446AQAWJECEduqasCCEA
packs
9
question pages
73
printable pages
118

Free for personal and classroom use - see copyright & terms.

See the method: Elements of Computational Thinking

A team is designing a new online cinema booking system. Use decomposition to identify three separate sub-problems the team would need to solve, and state one detail that could be abstracted away for one of your sub-problems at an early design stage.

  1. Break the overall system down into separate, manageable parts: (1) searching for and displaying available film showings, (2) selecting and reserving specific seats, (3) taking payment and issuing a booking confirmation.
  2. Check that each sub-problem can sensibly be designed and solved on its own, without needing to know the fine detail of the others yet.
  3. Choose one sub-problem, e.g. taking payment, and identify a detail that does not need to be decided yet, e.g. exactly which payment provider will process the card details.
  4. Final answer: sub-problems are (1) showing search/display, (2) seat selection, (3) payment and confirmation; for payment, the exact payment provider used can be abstracted away at this early stage.
Other A Level Computer Science strands
Every A Level Computer Science pack

Working on component 2: algorithms and programming

Algorithms and programming practice begins before a program runs. This component subset lets you move from breaking a problem into manageable parts to tracing how a particular procedure changes its variables. Elements of computational thinking is the A Level Computer Science topic covering the general problem-solving techniques used before writing any code, including abstraction, decomposition, pattern recognition and algorithmic thinking, alongside tools such as truth tables, Boolean simplification and backtracking. It opens the Component 2 Algorithms and Programming paper. Practise decomposition by breaking a described system into 3 or more clearly separate sub-problems before thinking about any code. Practise abstraction by identifying which details of a problem can be safely ignored at a given stage of design, and which are essential.

Recognise pattern recognition techniques, such as spotting repeated values (which run-length encoding exploits) or spotting repeated sub-problems in a recursive algorithm. Complete truth tables for logical expressions, then use a Boolean law such as De Morgan's to show two expressions are logically equivalent.

Elements of Computational Thinking

Elements of Computational Thinking method: Apply memoisation (caching results as they are calculated) to avoid recalculating the same value, and trace how a cache array fills as an algorithm runs. Trace backtracking algorithms step by step, noting the point at which a dead end is reached and the algorithm returns to try an alternative choice.

Worked example. A team is designing a new online cinema booking system. Use decomposition to identify three separate sub-problems the team would need to solve, and state one detail that could be abstracted away for one of your sub-problems at an early design stage.

  1. Break the overall system down into separate, manageable parts: (1) searching for and displaying available film showings, (2) selecting and reserving specific seats, (3) taking payment and issuing a booking confirmation.
  2. Check that each sub-problem can sensibly be designed and solved on its own, without needing to know the fine detail of the others yet.
  3. Choose one sub-problem, e.g. taking payment, and identify a detail that does not need to be decided yet, e.g. exactly which payment provider will process the card details.
  4. Final answer: sub-problems are (1) showing search/display, (2) seat selection, (3) payment and confirmation; for payment, the exact payment provider used can be abstracted away at this early stage.

Answer: Final answer: sub-problems are (1) showing search/display, (2) seat selection, (3) payment and confirmation; for payment, the exact payment provider used can be abstracted away at this early stage.

Problem Solving and Programming

Problem Solving and Programming method: Choose the correct primitive data type (INTEGER, REAL, BOOLEAN, CHAR, STRING) for each piece of data before writing any pseudocode. Trace iterative code (FOR, WHILE, REPEAT...UNTIL) line by line in a trace table, updating every variable after each line or iteration.

Convert between equivalent selection structures, e.g. rewriting a CASE statement as nested IF...THEN...ELSE, and check each is closed correctly. Use string-handling functions (LEN, MID, LEFT, RIGHT, ASC, UCASE) to validate or manipulate string data such as codes and names.

Worked example. A programmer writes: PROCEDURE Triple(BYREF x : INTEGER) x <- x * 3 ENDPROCEDURE. num1 <- 4. Triple(num1). OUTPUT num1. State the value output for num1, and explain why.

  1. Note that x is declared BYREF, meaning the parameter is passed by reference, so x inside the procedure refers to the same memory location as num1.
  2. Trace the call: num1 starts at 4, so when Triple(num1) is called, x also starts at 4.
  3. Inside the procedure, x <- x * 3 sets x to 12; because x is the same variable as num1, num1 also becomes 12.
  4. Final answer: OUTPUT num1 produces 12, because passing by reference means changes made to the parameter inside the procedure directly change the original variable.

Answer: Final answer: OUTPUT num1 produces 12, because passing by reference means changes made to the parameter inside the procedure directly change the original variable.

Keep going

Build these into a personalised pack.