Docsity

AS-LEVEL OCR COMPUTER SCIENCE PAPER 2 (H046/02): ALGORITHMS AND PROBLEM SOLVING. -- COMPR, Exams of Nursing

Toggle sidebar
bg1
Page 1 of 54
AS-LEVEL OCR COMPUTER SCIENCE PAPER 2 (H046/02): ALGORITHMS AND PROBLEM
SOLVING. -- COMPREHENSIVE —EXAM QUESTIONS LATEST EDITION 2026 – 2027
VERSION SOLVED QUESTIONS & ANSWERS
Q1. Which of the following best describes the term "abstraction" in computational
thinking?
A. Breaking a large problem into smaller, manageable sub-problems.
B. Removing unnecessary detail to focus on the essential features of a problem.
C. Writing code in a specific programming language.
D. Testing a program to ensure it produces the correct output.
Correct Answer: B
Rationale: Abstraction is the process of simplifying a problem by focusing on the
important details and omitting irrelevant ones .
Q2. Decomposition is best defined as:
A. The simplification of a problem by ignoring detail.
B. The process of breaking down a complex problem into manageable sub-steps.
C. The act of following logical steps to solve a problem.
D. The visual representation of an algorithm using standard symbols.
Correct Answer: B
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36

Partial preview of the text

Download AS-LEVEL OCR COMPUTER SCIENCE PAPER 2 (H046/02): ALGORITHMS AND PROBLEM SOLVING. -- COMPR and more Exams Nursing in PDF only on Docsity!

AS-LEVEL OCR COMPUTER SCIENCE PAPER 2 (H046/02): ALGORITHMS AND PROBLEM

SOLVING. -- COMPREHENSIVE —EXAM QUESTIONS LATEST EDITION 2026 – 2027

VERSION SOLVED QUESTIONS & ANSWERS

Q1. Which of the following best describes the term "abstraction" in computational thinking? A. Breaking a large problem into smaller, manageable sub-problems. B. Removing unnecessary detail to focus on the essential features of a problem. C. Writing code in a specific programming language. D. Testing a program to ensure it produces the correct output. Correct Answer: B Rationale: Abstraction is the process of simplifying a problem by focusing on the important details and omitting irrelevant ones. Q2. Decomposition is best defined as: A. The simplification of a problem by ignoring detail. B. The process of breaking down a complex problem into manageable sub-steps. C. The act of following logical steps to solve a problem. D. The visual representation of an algorithm using standard symbols. Correct Answer: B

Rationale: Decomposition is the breaking down of a complex problem into smaller, more manageable parts. Q3. Which of the following is NOT one of the three key components of computational thinking? A. Abstraction B. Decomposition C. Algorithmic thinking D. Compilation Correct Answer: D Rationale: The three key components are abstraction, decomposition, and algorithmic thinking. Compilation is a separate process. Q4. Algorithmic thinking involves: A. Only writing code in a text-based language. B. Following logical steps while utilising abstraction and decomposition to solve a problem. C. Ignoring the problem's details entirely. D. Using only visual tools like flowcharts. Correct Answer: B Rationale: Algorithmic thinking is the act of following logical steps, utilising abstraction and decomposition to solve a problem. Q5. A student is designing a program to manage a school library. They first identify the key tasks: adding books, removing books, and searching for books. What computational thinking technique are they applying?

Rationale: An algorithm is a set of instructions in a logical sequence designed to solve a problem. Q8. Pseudocode is useful because it: A. Can be executed directly by a computer without translation. B. Can be used to plan or outline an algorithm without worrying about the syntax of a specific language. C. Is a type of flowchart. D. Is only used for testing, not for design. Correct Answer: B Rationale: Pseudocode allows programmers to plan algorithms in a structured, human- readable format that is independent of any specific programming language. Q9. Which of the following is a benefit of using flowcharts? A. They can be executed directly by a computer. B. They provide a visual representation of an algorithm, making it easier to understand. C. They are the only way to design an algorithm. D. They are faster to create than pseudocode. Correct Answer: B Rationale: Flowcharts provide a visual representation of an algorithm using standard symbols, which can make the logic easier to follow. Q10. In a flowchart, which symbol is used to represent a decision? A. Rectangle B. Parallelogram C. Diamond

D. Curved rectangle Correct Answer: C Rationale: A diamond (or triangle) is the standard flowchart symbol for a decision. Q11. A trace table is used to: A. Visually represent an algorithm. B. Track the values of variables and outputs as a program runs. C. Translate pseudocode into machine code. D. Design the user interface of a program. Correct Answer: B Rationale: Trace tables track variable values and outputs through each iteration of a program, which is useful for debugging and understanding logic. Q12. In a trace table, what does each column typically represent? A. A line of code. B. A variable or output. C. An iteration of the program. D. A test case. Correct Answer: B Rationale: Each column in a trace table usually represents a different variable or output being tracked. Q13. What is the primary purpose of the "thinking ahead" stage in computational thinking? A. To write the final code. B. To consider the future implications and requirements of a solution before building it.

Q16. Which of the following best describes "thinking logically"? A. Guessing the answer to a problem. B. Using a step-by-step approach and reasoning to arrive at a solution. C. Relying on intuition only. D. Writing code without planning. Correct Answer: B Rationale: Thinking logically involves using reasoning and a structured approach to solve problems. Q17. What is meant by "thinking concurrently" in computational thinking? A. Doing one task at a time in sequence. B. Considering how different parts of a system can run at the same time to improve efficiency. C. Ignoring the time it takes to complete a task. D. Writing code that is difficult to read. Correct Answer: B Rationale: Thinking concurrently is about identifying tasks that can be executed in parallel to improve performance. Q18. Which of the following is an example of abstraction in a navigation app? A. Displaying the exact coordinates of every building. B. Showing only the major roads and key landmarks on the map. C. Including every possible route, no matter how small. D. Displaying real-time traffic data for every street. Correct Answer: B

Rationale: Showing only essential information (major roads, landmarks) simplifies the map for the user—this is abstraction. Q19. A software team is developing a large e-commerce system. They divide the work into modules for user accounts, product listings, shopping cart, and payment processing. This is an example of: A. Abstraction B. Decomposition C. Algorithmic thinking D. Debugging Correct Answer: B Rationale: Splitting a large system into smaller, functional modules is decomposition. Q20. The process of identifying similarities between problems and reusing solutions is known as: A. Pattern recognition B. Decomposition C. Abstraction D. Compilation Correct Answer: A Rationale: Pattern recognition involves spotting commonalities between problems to apply similar solutions. Q21. Which of the following is a key benefit of using pseudocode over a flowchart? A. Pseudocode is always more visually appealing. B. Pseudocode is easier to convert into actual code because its structure is closer to

Q24. In the context of computational thinking, "thinking ahead" is most closely related to: A. Debugging existing code. B. Considering the long-term consequences and future extensions of a solution. C. Writing the most efficient code possible without planning. D. Ignoring the needs of the user. Correct Answer: B Rationale: Thinking ahead involves anticipating future needs, potential issues, and how a solution might evolve. Q25. Which of the following best describes the relationship between decomposition and abstraction? A. They are the same thing. B. Abstraction simplifies parts of a problem, while decomposition breaks the overall problem into those parts. C. Decomposition is used only for hardware, abstraction only for software. D. Abstraction must be done before decomposition, and they are unrelated. Correct Answer: B Rationale: They are complementary techniques: you decompose a problem into smaller parts and use abstraction to focus on essential details within each part. Q26. A student is writing a program to calculate the average of a list of numbers. They first identify the steps: (1) sum the numbers, (2) count the numbers, (3) divide the sum by the count. This is an example of: A. Abstraction

B. Decomposition C. Concurrent thinking D. Pattern recognition Correct Answer: B Rationale: Breaking the process into distinct sub-steps is decomposition. Q27. Which of the following is NOT a benefit of using flowcharts? A. They provide a clear visual overview of an algorithm. B. They can be easier for non-programmers to understand. C. They are the fastest way to write executable code. D. They can help identify logical errors in a process. Correct Answer: C Rationale: Flowcharts are a design and communication tool, not a means of directly writing executable code. Q28. A programmer reuses a previously developed function for sorting data in a new project. This is an example of: A. Abstraction B. Pattern recognition and reuse C. Decomposition D. Concurrent thinking Correct Answer: B Rationale: Recognising that a sorting function from an old project solves a similar problem in a new context is pattern recognition.

D. Input, output, storage Correct Answer: A Rationale: The three fundamental constructs are sequence, selection, and iteration. Q32. Which construct is used to execute a block of code repeatedly? A. Sequence B. Selection C. Iteration D. Assignment Correct Answer: C Rationale: Iteration (looping) repeats a block of code. Q33. Which construct allows a program to choose between different paths based on a condition? A. Sequence B. Selection C. Iteration D. Recursion Correct Answer: B Rationale: Selection (e.g., IF statements) allows branching based on Boolean conditions. Q34. A FOR loop is an example of: A. Count-controlled iteration B. Condition-controlled iteration C. Selection

D. Sequence Correct Answer: A Rationale: A FOR loop runs a set number of times, making it count-controlled. Q35. A WHILE loop is an example of: A. Count-controlled iteration B. Condition-controlled iteration C. Selection D. Sequence Correct Answer: B Rationale: A WHILE loop runs as long as a condition is true, making it condition- controlled. Q36. What is the key difference between a WHILE loop and a DO...UNTIL loop? A. WHILE tests the condition at the start; DO...UNTIL tests it at the end. B. WHILE is count-controlled; DO...UNTIL is condition-controlled. C. WHILE can only be used with numbers; DO...UNTIL can be used with strings. D. There is no difference. Correct Answer: A Rationale: A WHILE loop is a pre-condition loop (tests before), while a DO...UNTIL loop is a post-condition loop (tests after). Q37. What is a local variable? A. A variable declared inside a subroutine, accessible only within that subroutine. B. A variable accessible from anywhere in the program. C. A variable that cannot be changed.

A. Parameters make the function run faster. B. Parameters make the function more self-contained and reusable, reducing dependencies. C. Parameters are the only way to pass data to a function. D. Parameters allow the function to access any variable in the program. Correct Answer: B Rationale: Passing data via parameters makes a function more modular and independent of external state, improving reusability and clarity. Q41. What is a procedure? A. A subroutine that returns a value. B. A subroutine that performs a task but does not return a value. C. A type of loop. D. A variable declaration. Correct Answer: B Rationale: A procedure is a subroutine that performs an action without returning a value, unlike a function. Q42. What is a function? A. A subroutine that performs a task without returning a value. B. A subroutine that returns a value. C. A type of conditional statement. D. A data structure. Correct Answer: B Rationale: A function is a subroutine that returns a value to the calling code.

Q43. What does the term "reusable program component" mean? A. A component that can only be used once. B. A self-contained module of code that can be used in multiple programs or parts of a program. C. A component that is specific to one hardware platform. D. A component that cannot be modified. Correct Answer: B Rationale: Reusable components are designed to be used in multiple contexts, saving development time and improving reliability. Q44. Why should a programmer create reusable program components? A. To make the code longer and more complex. B. To save time, reduce errors, and improve maintainability by not reinventing the wheel. C. To prevent other programmers from understanding the code. D. Because it is required by the exam board. Correct Answer: B Rationale: Reusable components improve efficiency, consistency, and reduce the chance of bugs because they have already been tested. Q45. What is the purpose of an IDE (Integrated Development Environment)? A. To provide a single environment with tools for writing, testing, and debugging code. B. To replace the need for a compiler. C. To design the user interface only. D. To manage the computer's hardware. Correct Answer: A

Correct Answer: B Rationale: DIV performs integer division, returning only the whole number part. Q49. What is a constant? A. A variable that can change during program execution. B. A value that does not change during program execution. C. A type of loop. D. A function that returns a value. Correct Answer: B Rationale: A constant is a named value that remains fixed throughout the program's execution. Q50. Why are constants useful in programming? A. They make the code run faster. B. They improve readability and prevent accidental changes to fixed values. C. They allow the program to accept user input. D. They are required for all calculations. Correct Answer: B Rationale: Constants improve code clarity and safety by ensuring that values meant to be fixed are not modified inadvertently. Q51. What is the difference between passing a parameter by value and by reference? A. By value passes a copy; by reference passes the memory address, allowing the original to be modified. B. By value passes the memory address; by reference passes a copy.

C. There is no difference. D. By value can only be used with integers; by reference can only be used with strings. Correct Answer: A Rationale: Pass by value copies the data, so changes inside the subroutine do not affect the original. Pass by reference allows the subroutine to modify the original variable. Q52. When should a parameter be passed by reference? A. When the subroutine needs to modify the original value. B. When the value should not be changed. C. When the data type is a string. D. When the subroutine is a function, not a procedure. Correct Answer: A Rationale: Passing by reference is used when the subroutine needs to update the original data, such as in a procedure that sorts an array in place. Q53. What is recursion? A. A loop that runs forever. B. A subroutine that calls itself to solve a smaller version of the same problem. C. A type of variable. D. A way to pass parameters. Correct Answer: B Rationale: Recursion is a technique where a function or procedure calls itself, typically to solve a problem by breaking it into smaller instances. Q54. What is a base case in a recursive subroutine? A. The case that causes infinite recursion.