Chapter 6: Specification and Abstraction — Online MCQ Test
COMPUTER SCIENCE · CLASS 11th · Tamil Nadu State Board
Practice Chapter 6: Specification and Abstraction with a free chapter-wise online MCQ test.
This chapter covers: Introducing algorithmic problem-solving principles this chapter details algorithm specification state representation and abstraction techniques. Students model real-world problems....
AI-generated questions from basic to board-exam level, with instant results and explanations.
Chapter 6: Specification and Abstraction — Important Questions & Answers
What is the primary purpose of abstraction in computer science?
- A. To hide complex details and show only essential features
- B. To increase the length of the code
- C. To make the algorithm execute faster
- D. To eliminate the need for variables
Answer: A. To hide complex details and show only essential features
Abstraction allows users to interact with a system through a simple interface while hiding the complex implementation details.
Abstraction allows users to interact with a system through a simple interface while hiding the complex implementation details.
An algorithm specification is defined by which two components?
- A. Input and Output
- B. Pre-condition and Post-condition
- C. Compiler and Interpreter
- D. Variables and Constants
Answer: B. Pre-condition and Post-condition
Specification involves defining the state of the system before (pre-condition) and after (post-condition) the algorithm executes.
Specification involves defining the state of the system before (pre-condition) and after (post-condition) the algorithm executes.
If the pre-condition for a division algorithm is 'denominator is not zero', what type of check is this?
- A. Output constraint
- B. Implementation detail
- C. Input constraint
- D. Loop invariant
Answer: C. Input constraint
Pre-conditions act as constraints on the input to ensure the algorithm can function correctly.
Pre-conditions act as constraints on the input to ensure the algorithm can function correctly.
Which scenario best demonstrates the need for formal specification?
- A. Writing a simple print statement
- B. Developing a complex banking transaction system
- C. Changing the font of a text file
- D. Deleting a temporary file
Answer: B. Developing a complex banking transaction system
Formal specification is essential in critical systems where errors can lead to serious consequences, such as banking.
Formal specification is essential in critical systems where errors can lead to serious consequences, such as banking.
In a formal proof of an algorithm, what is the role of the pre-condition?
- A. It acts as the starting point (base case) for the proof
- B. It is irrelevant to the proof
- C. It forces the loop to terminate
- D. It determines the complexity class
Answer: A. It acts as the starting point (base case) for the proof
The proof assumes the pre-condition is true at the start, ensuring that the algorithm starts from a valid known state.
The proof assumes the pre-condition is true at the start, ensuring that the algorithm starts from a valid known state.