Docsity

PROGRAMMING - ASSIGNMENT 1 COMPUTATIONAL THINKING SKILLS EXAM BANK, Exams of Information Technology

Toggle sidebar
bg1
====================================================
UNIT 4: PROGRAMMING - ASSIGNMENT 1
COMPUTATIONAL THINKING SKILLS EXAM BANK
Total Questions: 200
Covers: P1, P2, P3, M1
====================================================
INSTRUCTIONS: For each question, select the single best answer. The correct answer is indicated with
[ANSWER: X] and followed by a rationale.
=====================================================
SECTION A: DECOMPOSITION (Questions 1-25)
=====================================================
Q1. What is decomposition in computational thinking?
A) Writing code without planning
B) Breaking down a complex problem into smaller, more manageable sub-problems
C) Removing unnecessary details from a problem
D) Finding similarities between different problems
[ANSWER: B]
RATIONALE: Decomposition is the process of dividing a large, complex problem into smaller,
independent parts that are easier to understand, solve, and manage.
Q2. Why is decomposition a critical first step in programming?
A) It eliminates the need for testing
B) It allows multiple programmers to work on different parts simultaneously and simplifies the overall
complexity
C) It automatically writes the code for the programmer
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download PROGRAMMING - ASSIGNMENT 1 COMPUTATIONAL THINKING SKILLS EXAM BANK and more Exams Information Technology in PDF only on Docsity!

UNIT 4: PROGRAMMING - ASSIGNMENT 1

COMPUTATIONAL THINKING SKILLS EXAM BANK

Total Questions: 200

Covers: P1, P2, P3, M

INSTRUCTIONS: For each question, select the single best answer. The correct answer is indicated with [ANSWER: X] and followed by a rationale. ===================================================== SECTION A: DECOMPOSITION (Questions 1-25) ===================================================== Q1. What is decomposition in computational thinking? A) Writing code without planning B) Breaking down a complex problem into smaller, more manageable sub-problems C) Removing unnecessary details from a problem D) Finding similarities between different problems [ANSWER: B] RATIONALE: Decomposition is the process of dividing a large, complex problem into smaller, independent parts that are easier to understand, solve, and manage. Q2. Why is decomposition a critical first step in programming? A) It eliminates the need for testing B) It allows multiple programmers to work on different parts simultaneously and simplifies the overall complexity C) It automatically writes the code for the programmer

D) It makes the program run faster [ANSWER: B] RATIONALE: Decomposition enables parallel development, easier debugging, and better organization. It doesn't eliminate testing or automatically generate code. Q3. Which of the following is the BEST example of decomposition? A) Creating a single, 500-line script to handle all user inputs B) Dividing a 'Checkout System' into sub-problems: 'Calculate Total', 'Apply Discount', and 'Process Payment' C) Using a single variable to store all customer data D) Ignoring error handling to simplify the code [ANSWER: B] RATIONALE: Breaking a checkout system into distinct functions (calculate, discount, payment) is a classic example of decomposing a large task into smaller, focused sub-tasks. Q4. In a 'Library Management System', which decomposed component is correctly identified? A) Single module for 'Manage Books', 'Manage Members', and 'Handle Loans' B) Separate modules for 'Book Catalog', 'Member Registry', and 'Loan Transactions' C) One large function for the entire system D) A module that only handles printing receipts [ANSWER: B] RATIONALE: Separating the library system into distinct modules based on core functionalities (books, members, loans) demonstrates effective decomposition. Q5. What is a key benefit of using decomposition when designing a solution for a client? A) The final program will always be bug-free B) The client can understand the code better because there is less of it C) It allows the client to see the problem broken down into logical parts, making it easier to provide feedback on specific areas D) It guarantees the project will be completed in half the time

Q9. You are asked to create a game of chess. What is the first decomposed sub-problem you would likely identify? A) The movement rules for each chess piece B) The initial setup of the board C) The AI difficulty level D) The graphics resolution [ANSWER: B] RATIONALE: While all are parts, the setup of the board is a foundational, independent sub-problem that must be solved before gameplay can begin. Q10. Decomposition helps with code reusability. Why? A) Because decomposed sub-problems can be packaged into modules that can be reused in other programs B) Because it copies code automatically C) Because it uses fewer variables D) Because it shortens the code by 50% [ANSWER: A] RATIONALE: When you decompose a problem into self-contained modules, those modules can often be repurposed for future projects, saving development time. Q11. Which of the following is a valid decomposition of a 'Student Grading System'? A) One function that inputs, validates, calculates, and outputs the grade B) Separate functions for: InputGradeData, ValidateGrade, CalculateAverage, and DisplayResults C) A single array that stores all student names D) A loop that runs 100 times [ANSWER: B] RATIONALE: This breaks the grading process into logical, sequential steps, each with a single responsibility—a perfect example of decomposition.

Q12. When decomposing a problem, which of the following should be avoided? A) Creating modules that overlap in functionality B) Creating modules with clear inputs and outputs C) Creating modules that can be tested individually D) Creating modules that are independent of each other [ANSWER: A] RATIONALE: Overlapping functionality violates the principle of 'Separation of Concerns' and makes the system harder to maintain and debug. Q13. Decomposition is part of which wider computing concept? A) Machine Learning B) Computational Thinking C) Data Science D) Networking [ANSWER: B] RATIONALE: Decomposition is one of the four pillars of Computational Thinking (alongside Pattern Recognition, Abstraction, and Algorithms). Q14. A company wants to create a mobile app. They divide the work into UI design, back-end development, and database management. This is an example of: A) Pattern recognition B) Abstraction C) Decomposition D) Algorithm design [ANSWER: C] RATIONALE: Dividing a large project (the app) into smaller, parallelizable components (UI, back-end, database) is decomposition. Q15. What is the ultimate goal of decomposition in terms of project management? A) To reduce the need for a project manager

[ANSWER: B]

RATIONALE: 'Divide and conquer' is exactly the strategy of decomposition: split, solve individually, and integrate. Q19. In a 'Hotel Booking System', decomposing the problem into 'Room Availability', 'Guest Management', and 'Billing' is beneficial because: A) It allows the billing team to change prices without affecting how rooms are checked for availability B) It reduces the amount of code written C) It makes the system run on older computers D) It uses less electricity [ANSWER: A] RATIONALE: Decomposition creates loose coupling. Changes to one module (e.g., billing) should have minimal impact on the other modules (e.g., availability), making maintenance easier. Q20. Which of the following is NOT a valid reason to use decomposition? A) To simplify problem-solving B) To allow for team collaboration C) To hide the existence of the problem D) To make testing and debugging more focused [ANSWER: C] RATIONALE: Decomposition is a strategy for addressing the problem head-on, not hiding it. Q21. A complex mathematical formula needs to be implemented. How can decomposition help? A) By breaking the formula into smaller algebraic steps (e.g., calculate A, then calculate B, then combine A and B) B) By memorizing the formula C) By using a calculator D) By writing the formula in all capital letters [ANSWER: A]

RATIONALE: Decomposition can be applied to formulas by breaking them down into a sequence of simpler arithmetic operations. Q22. When decomposing a problem, what is the relationship between the sub-problems and the overall solution? A) The sub-problems are optional B) The sub-problems are independent of the overall solution C) The solution of all sub-problems is integrated to create the final, complete solution D) Only one sub-problem needs to be solved for the whole solution to work [ANSWER: C] RATIONALE: The whole is the sum of its parts. The final solution is built by combining the solutions to all the decomposed sub-problems. Q23. Which of these is a good indicator that you have decomposed a problem well? A) You can describe each sub-problem in a single sentence B) You have exactly 10 sub-problems C) You have used all the letters of the alphabet as variable names D) Each sub-problem takes exactly one hour to solve [ANSWER: A] RATIONALE: If each sub-problem can be clearly and concisely described, it indicates you have identified meaningful, atomic units of work. Q24. Decomposition is often the first step in the programming process. What comes immediately after decomposition? A) Writing the final code B) Deployment to the server C) Identifying patterns and abstracting common features D) User acceptance testing [ANSWER: C] RATIONALE: In computational thinking, after decomposing, you typically look for patterns (P3) and abstract them (P2) before designing the algorithm.

RATIONALE: A subway map is an abstraction. It removes unnecessary geographical details (streets, parks) and highlights only the relevant information (stations and routes) for navigating the subway system. Q28. In programming, why would you create a 'Customer' object with properties like 'Name' and 'ID', but not 'Hair Color'? A) Because hair color is hard to code B) Because 'Hair Color' is likely irrelevant to a banking application's functionality C) Because memory cannot store hair color D) Because all customers have the same hair color [ANSWER: B] RATIONALE: Abstraction involves selecting only the attributes that are relevant to the system. Hair color is usually irrelevant for a banking app, so it is abstracted away. Q29. What is the difference between abstraction and decomposition? A) There is no difference, they are the same thing B) Decomposition breaks a problem into parts; abstraction removes unnecessary details from those parts C) Abstraction breaks a problem into parts; decomposition removes details D) They are both about making code run faster [ANSWER: B] RATIONALE: They are complementary. Decomposition is about structure (splitting), while abstraction is about simplification (filtering details). Q30. A car dashboard is an abstraction of the car's engine status. Why? A) It shows every single detail about how the engine works B) It shows simplified, essential information (speed, fuel level, temperature) and hides the complex mechanics C) It replaces the engine entirely D) It makes the car faster [ANSWER: B]

RATIONALE: The dashboard abstracts away the internal combustion and mechanical complexity and presents only the data the driver needs to know to operate the vehicle safely. Q31. When creating a class diagram for a 'Book' in a library system, which attribute would be considered an unnecessary detail to include? A) ISBN Number B) Author Name C) Number of Pages D) The chemical composition of the paper [ANSWER: D] RATIONALE: The chemical composition of the paper is irrelevant to the library's function of tracking and lending books. It is a non-essential detail that should be abstracted away. Q32. Which of the following statements best describes the benefit of abstraction in large software projects? A) It makes the code slower to execute B) It allows programmers to ignore complex subsystems and interact with them through simple interfaces (APIs) C) It duplicates the code for safety D) It prevents the program from using the internet [ANSWER: B] RATIONALE: Abstraction allows developers to use complex systems (like databases or networking) through simplified APIs without needing to understand their internal complexities. This is the core of 'black box' thinking. Q33. In the context of P2, what is the primary purpose of using abstraction? A) To create a physical model of the system B) To define and create a simplified model of the problem to focus on solving the core issues C) To gather feedback from end-users D) To encrypt the data for security [ANSWER: B]

Q37. Using abstraction helps reduce the complexity of a problem. How? A) By making the problem bigger B) By hiding irrelevant details, allowing the programmer to focus on the important parts C) By removing all variables D) By using only integers [ANSWER: B] RATIONALE: Abstraction acts as a filter. It simplifies the problem space by removing 'noise' (irrelevant details) so the programmer can concentrate on the 'signal' (the core logic). Q38. When designing a system to calculate payroll, which detail would you abstract away? A) Employee's hourly rate B) Employee's full name C) Hours worked D) The color of the employee's office chair [ANSWER: D] RATIONALE: The color of a chair has no bearing on payroll calculations and is therefore a prime candidate for abstraction. Q39. Abstraction is often used in conjunction with decomposition. After decomposing a system into sub- systems, what does abstraction do? A) It merges all the sub-systems back together B) It defines the essential interface and data for each sub-system, hiding the internal implementation C) It deletes the sub-systems D) It assigns colors to each sub-system [ANSWER: B] RATIONALE: Once you have your modules (decomposition), you define their public interfaces and hide their internal complexity (abstraction). Q40. Which of the following is NOT a benefit of using abstraction?

A) It makes the code easier to understand B) It protects the user from unnecessary complexity C) It ensures the code has zero bugs D) It allows for changes to be made inside a module without affecting other modules [ANSWER: C] RATIONALE: Abstraction helps manage complexity and minimize errors, but it does not guarantee a completely bug-free system. Q41. A 'database connection object' provides methods like connect() and query(). You don't need to know the network protocol. This is an example of: A) Inheritance B) Abstraction C) Polymorphism D) Decomposition [ANSWER: B] RATIONALE: The database object abstracts away the complex network communication and low-level socket handling behind simple, high-level methods. Q42. What is the result of effective abstraction when reading someone else's code? A) You must read every line of code to understand the program B) You can understand what a function does by its name and parameters, without reading its internal code C) The code becomes unreadable D) You have to compile the code first [ANSWER: B] RATIONALE: Effective abstraction uses meaningful names and clear interfaces so that a function's purpose is evident from its signature alone. Q43. A delivery company uses an abstract model of a 'Route'. Which of these details is essential to the Route model? A) The driver's favorite music

C) It confuses them so they ask fewer questions D) It isn't important [ANSWER: B] RATIONALE: Abstraction helps translate technical concepts into business language by focusing on what the system will do (requirements) rather than how it will be built (code). Q47. A developer using a library to generate PDFs doesn't need to know the binary structure of a PDF file. This is because the library provides: A) A lack of documentation B) An abstraction layer C) More complexity D) Unstable code [ANSWER: B] RATIONALE: The library creates an abstraction layer that hides the complex binary formatting of a PDF behind simple functions like addText() or saveFile(). Q48. What is the relationship between abstraction and 'information hiding'? A) They are unrelated B) They are the same concept; abstraction often uses information hiding to protect internal details C) Information hiding makes abstraction harder D) Abstraction is always bad [ANSWER: B] RATIONALE: Information hiding is a key mechanism for implementing abstraction. By hiding internal states and functions, we enforce the abstract interface. Q49. A simulation of a weather system uses abstraction. Which of the following is LEAST likely to be abstracted away? A) The specific type of cloud B) The temperature C) Wind speed

D) The names and birthdays of people in the city [ANSWER: D] RATIONALE: People's names and birthdays are irrelevant to a weather simulation. Temperature and wind speed are essential parameters. Q50. What does an 'abstract data type' (ADT) like a Stack or Queue define? A) The specific programming language to use B) The logical behavior and operations, rather than the implementation details C) The color of the data D) The memory address of the first element [ANSWER: B] RATIONALE: An ADT defines the operations (e.g., push, pop, enqueue, dequeue) and their logical behavior, abstracting away how they are actually implemented. ===================================================== SECTION C: PATTERN RECOGNITION (Questions 51-75) ===================================================== Q51. What is pattern recognition in computational thinking? A) Finding random numbers B) Identifying similarities or common differences in data/problems to simplify solutions C) Drawing geometric shapes on a screen D) Checking for spelling errors [ANSWER: B] RATIONALE: Pattern recognition involves looking for commonalities, trends, or regularities among different problems or datasets. Q52. Pattern recognition is useful because: A) It helps us write code faster without thinking B) If we identify a pattern, we can reuse a previously developed solution or algorithm

[ANSWER: B]

RATIONALE: Binary Search relies on the pattern of sorted data to repeatedly divide the search interval in half. This is a classic pattern. Q56. How does pattern recognition relate to code reusability? A) It prevents code from being reused B) By identifying common problems, you can write reusable functions/classes to solve them C) It forces you to write new code for every problem D) It has no relation [ANSWER: B] RATIONALE: Recognizing that multiple parts of a program require the same logic (e.g., validating input) allows you to write a single reusable function. Q57. While analyzing a dataset, you notice that every Saturday, sales spike. This is an example of: A) Decomposition B) Abstraction C) Pattern recognition D) Algorithm design [ANSWER: C] RATIONALE: Observing a repeating trend in data (weekly sales spike) is pattern recognition. Q58. Which of the following is a common pattern used in programming for repeating tasks? A) If-Else statement (used once) B) Variable assignment C) Loops (For, While) D) Import statement [ANSWER: C] RATIONALE: Loops are the primary programming construct used to automate the pattern of repetition.

Q59. A developer notices that several functions in a program all start by checking if a user is logged in. What pattern should they abstract? A) The color scheme of the UI B) The user authentication check into a single function C) The database connection string D) The file extension [ANSWER: B] RATIONALE: Recognizing the repeated pattern of 'checking login status' means this logic should be abstracted into a reusable isLoggedIn() function to avoid code duplication. Q60. In computational thinking, what does P3 focus on? A) Breaking down problems B) Removing unnecessary details C) Using pattern recognition and algorithms to design solutions D) Testing the final product [ANSWER: C] RATIONALE: P3 explicitly covers using pattern recognition and algorithms as the tools to design a solution to the problem. Q61. The sequence 2, 4, 6, 8, 10... displays a pattern. What is the algorithm to generate the next number? A) Add 2 B) Multiply by 2 C) Add 1 D) Subtract 1 [ANSWER: A] RATIONALE: The pattern is arithmetic progression with a common difference of +2. Q62. Recognizing patterns is critical for debugging. Why? A) Bugs never repeat