Get the most accurate TN Board Solutions for Class 11 Computer Science Chapter 07 Composition and Decomposition here. Updated for the 2026-27 academic session, these solutions are based on the latest TN Board textbooks for Class 11 Computer Science. Our expert-created answers for Class 11 Computer Science are available for free download in PDF format.
Detailed Chapter 07 Composition and Decomposition TN Board Solutions for Class 11 Computer Science
For Class 11 students, solving TN Board textbook questions is the most effective way to build a strong conceptual foundation. Our Class 11 Computer Science solutions follow a detailed, step-by-step approach to ensure you understand the logic behind every answer. Practicing these Chapter 07 Composition and Decomposition solutions will improve your exam performance.
Class 11 Computer Science Chapter 07 Composition and Decomposition TN Board Solutions PDF
Part I
Choose the correct answer.
Question 1. Suppose u, v = 10, 5 before the assignment. What are the values of u and v after the sequence of assignments?
1. u := v
2. v := u
(a) u, v = 5, 5
(b) u, v = 5, 10
(c) u, v = 10, 5
(d) u, v = 10, 10
Answer: (a) u, v = 5, 5
In simple words: Initially, u is 10 and v is 5. First, u takes the value of v (so u becomes 5). Then, v takes the current value of u (which is now 5), so v also becomes 5. This leads to both u and v having the value 5.
๐ฏ Exam Tip: Tracing variable values step-by-step is crucial in such questions. Remember that assignments use the *current* value of a variable at the time of assignment.
Question 2. Which of the following properties is true after the assignment (at line 3)?
1. \( i + j = 0 \)
2. \( i, j := i + 1, j - 1 \)
3. -?
(a) \( i + j >0 \)
(b) \( i + j < 0 \)
(c) \( i + j = 0 \)
(d) \( i = j \)
Answer: (c) \( i + j = 0 \)
In simple words: If you add 1 to 'i' and subtract 1 from 'j', the sum of 'i' and 'j' stays the same. So, if their sum was 0 before, it will still be 0 after these changes.
๐ฏ Exam Tip: Notice that the changes to \( i \) and \( j \) are inverse operations (\( +1 \) and \( -1 \)). This means their sum \( i+j \) remains unchanged if it was initially zero.
Question 3. If C1 is false and C2 is true, the compound statement,
1. if C1
2. S1
3. else
4. if C2
5. S2
6. else
7. S3
executes
(a) S1
(b) S2
(c) S3
(d) none
Answer: (b) S2
In simple words: Since C1 is false, the program skips S1 and goes to the 'else' part. Inside that 'else', it checks C2. Since C2 is true, it executes S2 and then finishes.
๐ฏ Exam Tip: For nested conditional statements, trace the execution path carefully based on the truth values of each condition, moving inwards or outwards as required.
Question 4. If C is false just before the loop, the control flows through.
1. S1
2. while C
3. S2
4. S3
(a) S1; S3
(b) S1; S2; S3
(c) S1; S2; S2; S3
(d) S1; S2; S2; S2; S3
Answer: (a) S1; S3
In simple words: The program first executes S1. Then, it checks the 'while C' loop condition. Since C is false, the loop (which would execute S2) is skipped entirely. After the loop, the program moves on to execute S3.
๐ฏ Exam Tip: A 'while' loop checks its condition *before* executing its body. If the condition is false from the start, the loop body is never executed.
Question 5. If C is true, S1 is executed in both the flowcharts, but S2 is executed in
(a) (1) only
(b) (2) only
(c) both (1) and (2)
(d) neither (1) nor (2)
Answer: (a) (1) only
In simple words: When condition C is true, S1 is always run. In the first flowchart (1), if C is true, S1 runs. Then, the control flow from S1 leads to S2, so S2 runs. In the second flowchart (2), if C is true, S1 runs, but the flow from S1 does *not* lead to S2; it continues past S2. Only if C is false would S2 run in flowchart (2). Therefore, S2 is executed only in flowchart (1).
๐ฏ Exam Tip: Carefully follow the arrows in flowcharts. A true condition usually follows one path, and a false condition follows another. Pay attention to how the paths merge or diverge.
Question 6. How many times the loop is iterated? \( i := 0 \) while \( i \neq 5 \) \( i := i + 1 \)
(a) 4
(b) 5
(c) 6
(d) 0
Answer: (b) 5
In simple words: The loop starts with \( i = 0 \). It keeps running as long as \( i \) is not 5. Each time it runs, \( i \) increases by 1. So, \( i \) will be 0, then 1, 2, 3, 4, and then finally becomes 5. At this point, \( i \neq 5 \) becomes false, and the loop stops. This means the loop body runs 5 times in total (for \( i = 0, 1, 2, 3, 4 \)).
๐ฏ Exam Tip: When tracing loops, always keep track of the variable's value and the exact condition that causes the loop to terminate. This helps prevent off-by-one errors.
Part II
Short Answer Questions
Question 1. Distinguish between a condition and a statement.
Answer:
| Condition | Statement |
|---|---|
| It is a phrase that describes a test of the state. | It is a phrase that commands the computer to do an an action. |
| A condition always results in a true or false value. | A statement performs an action or changes the state of the program. |
In simple words: A condition is like asking a "yes" or "no" question to the computer, which results in true or false. A statement is like giving a command to the computer to do something.
๐ฏ Exam Tip: Clearly define the purpose and outcome of both conditions and statements. Conditions determine program flow, while statements perform operations.
Question 2. Draw a flowchart for a conditional statement.
Answer:
Conditional control flow
In simple words: This picture shows how a computer program makes a decision. It checks a condition (C). If the condition is true, it does one thing (S). If it's false, it skips that thing. After that, the program continues from the same point, whether the thing was done or not.
๐ฏ Exam Tip: For flowcharts, remember to use diamond shapes for conditions and rectangles for statements. Arrows show the flow, and merging paths indicate where program execution continues after a decision.
Question 3. Both conditional statements and iterative statements have a condition and a statement. How do they differ?
Answer:
Conditional Statement:
- Statements are executed only once when the condition is true.
- This includes 'if' condition statements.
Iterative Statement:
- An iterative statement repeatedly checks a condition and executes a statement until the condition becomes false.
- This includes 'while' condition statements. This repetitive execution is often called a loop.
In simple words: A conditional statement runs a block of code just one time if a condition is met. An iterative statement, or loop, runs a block of code again and again as long as its condition stays true.
๐ฏ Exam Tip: The key difference lies in repetition. Conditional statements perform actions once based on a condition, while iterative statements perform actions repeatedly until a condition is no longer met.
Question 4. What is the difference between an algorithm and a program?
Answer:
| ALGORITHM | PROGRAM |
|---|---|
| It is a step-by-step procedure to solve a problem. | It is a set of instructions to solve a problem by the computer. |
| No need to follow the grammar of a language. | Follow strictly the grammar of a programming language. |
| Algorithms are conceptual and human-readable steps. | Programs are executable code written in a specific language. |
In simple words: An algorithm is a detailed plan or recipe for solving a problem, written in simple language that humans can understand. A program is that same plan translated into a special computer language, which a computer can then run.
๐ฏ Exam Tip: An algorithm describes *what* to do, while a program describes *how* to do it in a way a computer understands. Remember that algorithms are language-independent.
Question 5. Why is a function an abstraction?
Answer: Once a function is defined, it can be used repeatedly without needing to know its internal details. This ability to reuse a single function many times, focusing on *what* it does rather than *how* it does it, is known as abstraction. Abstraction simplifies complex systems by hiding unnecessary details from the user. For instance, when you use a function like `print()`, you don't need to know the code inside it, just that it displays text.
In simple words: A function is like a simple tool. You know what it does (its purpose) but you don't need to know all the tiny steps inside it to use it. This way of hiding details and showing only the main idea is called abstraction.
๐ฏ Exam Tip: Focus on the concept of "hiding complexity" when explaining abstraction. A function encapsulates a task, allowing users to interact with it at a higher, simpler level.
Question 6. How do we define a statement?
Answer: In refinement, we start with a high-level goal, and then each statement is repeatedly expanded into more detailed statements in the subsequent levels. A statement is a phrase that gives a command to the computer to perform an action. For example, `x = 5` is a statement that assigns the value 5 to the variable `x`.
In simple words: A statement is a command that tells the computer to do something. You start with big ideas and then break them into smaller, more specific commands.
๐ฏ Exam Tip: Think of a statement as a single, executable instruction within an algorithm or program. It describes an action the computer should perform.
Part III
Explain in brief
Question 1. For the given two flowcharts write the pseudo-code.
Answer:
PSEUDO CODE FOR FIRST FLOWCHART
if condition is True
Execute Statement S1
else
Execute Statement S2
endif
PSEUDO CODE FOR SECOND FLOWCHART
if the condition is True
Execute Statement S1
Execute Statement S2
else
Execute Statement S2
endif.
In simple words: The first flowchart shows a simple 'if-else' choice: do S1 if true, else do S2. The second flowchart is different: if the condition is true, both S1 and S2 run. If the condition is false, only S2 runs.
๐ฏ Exam Tip: When writing pseudocode from flowcharts, accurately represent the branching logic (if/else) and sequential execution. Pay close attention to whether branches merge or continue independently.
Question 2. If C is false in line 2, trace the control flow in this algorithm.
1. S1
2. - C is false
3. if C
4. S2
5. else
6. S3
7. S4
Answer: The control flow for the given algorithm is as follows:
S1
S3
S4
The condition C is false, so it executes S3. In this case, S2 is skipped. The program first runs S1. Then, because C is false, the 'if C' block (S2) is skipped, and the 'else' block (S3) is executed. After that, S4 is executed. This process ensures that only S1, S3, and S4 are carried out.
In simple words: The computer starts with S1. Since C is false, it jumps over S2 and runs S3. Then, it finishes by running S4.
๐ฏ Exam Tip: Tracing control flow requires careful attention to conditions. If an 'if' condition is false, the 'else' block (if present) is executed, and the 'if' block is always skipped.
Question 3. What is case analysis?
Answer: Case analysis is a statement that generalizes a problem into multiple distinct cases. It divides the problem into an exhaustive set of disjoint cases. This means that every possible scenario is covered by exactly one case, making the problem easier to solve by addressing each specific situation separately. This approach helps in systematically handling complex decision-making processes.
In simple words: Case analysis means breaking a big problem into many smaller, separate situations. Each small situation is handled one by one, making sure every possibility is covered.
๐ฏ Exam Tip: Remember that for effective case analysis, the cases must be exhaustive (cover all possibilities) and disjoint (no overlaps). This ensures clarity and correctness in problem-solving.
Question 4. Draw a flowchart for -3 case analysis using alternative statements.
Answer:
In simple words: This flowchart shows a multi-step decision. It checks C1 first. If true, it does S1 and skips the rest. If C1 is false, it checks C2. If C2 is true, it does S2 and skips the rest. If C2 is false, it checks C3. If C3 is true, it does S3. If all C1, C2, C3 are false, it does S4. After any of these actions, the program moves to the "Next St" step.
๐ฏ Exam Tip: For nested conditional flowcharts, ensure that each 'true' path leads to its respective statement and then merges to the common exit point, while 'false' paths continue to the next condition.
Question 5. Define a function to double a number in two different ways: (1) \( n + n \), (2) \( 2 \times n \).
Answer: A function can be defined to double a number using two equivalent mathematical expressions, both achieving the same result.
1. Double (n)
- inputs: \( n \) is a real number or an integer, \( n > 0 \)
- Outputs: \( y \) is a real number or an integer such that \( y = n + n \)
2. Double (n)
- inputs: \( n \) is a real number or an integer, \( n > 0 \)
- Outputs: \( y \) is a real number or an integer such that \( y = 2 \times n \)
In simple words: A function can make a number twice as big in two ways: either by adding the number to itself (like \( 5 + 5 = 10 \)) or by multiplying it by two (like \( 5 \times 2 = 10 \)). Both ways give the same result.
๐ฏ Exam Tip: When defining functions, clearly specify the inputs (parameters) and the expected outputs, including any constraints on the input values (like \( n > 0 \)).
Part IV
Explain in detail
Question 1. Exchange the contents: Given two glasses marked A and B. Glass A is full of apple drink and glass B is full of grape drink. Write the specification for exchanging the contents of glasses A and B, and write a sequence of assignments to satisfy the specification.
Answer: To exchange the contents of two variables (like glasses A and B) without losing any data, a temporary variable (like T) is needed. This is a common pattern in programming.
The sequence of assignments to satisfy the specification:
exchange(A, B)
-inputs: A, B are real and > 0
-outputs: A, B are real and > 0
State representation
T = A
A: = B
B: = T
In simple words: Imagine you have two glasses with different drinks. To swap them, you need a third empty glass. First, pour drink A into the third glass. Then, pour drink B into glass A. Finally, pour the drink from the third glass into glass B.
๐ฏ Exam Tip: The classic "swap two variables" problem always requires a third temporary variable to avoid data loss. This is a fundamental concept in programming.
Question 2. Circulate the contents: Write the specification and construct an algorithm to circulate the contents of the variables A, B and C as shown below: The arrows indicate that B gets the value of A, C gets the value of B and A gets the value of C.
Answer: To circulate the contents of three variables (A, B, C) such that A gets C's value, B gets A's value, and C gets B's value, we again need a temporary variable (T) to hold one value while the others are shifted. This ensures no data is overwritten before it's used.
Specification:
Circulated(A, B, C)
- inputs: A, B, C all are real numbers
- outputs: A, B, C, all are real numbers
Algorithm:
T: = C
C: = B
B: = A
A: = T
Alternatively, using the problem's variable names directly (if A,B,C are variables instead of functions):
i) circulated(A,B,C)
ii) - A,B,C
iii) T = C
iv) C = B
v) B = A
vi) A: = T
In simple words: If you have three boxes (A, B, C) with different items and you want to move them around in a circle (A gets C's item, B gets A's, C gets B's), you first need a spare box (T). You put C's item into T. Then, B's item goes to C, A's item goes to B, and finally, T's item goes to A.
๐ฏ Exam Tip: For circulation problems involving multiple variables, carefully plan the sequence of assignments to avoid overwriting values prematurely. A temporary variable is essential to store a value before it's lost.
Question 3. Decanting problem. You are given three bottles of capacities 5, 8, and 3 litres. The 8L bottle is filled with oil, while the other two are empty. Divide the oil in an 8L bottle into two equal quantities. Represent the state of the process by appropriate variables. What are the initial and final states of the process? Model the decanting of oil from one bottle to another by assignment. Write a sequence of assignments to achieve the final state.
Answer: The decanting problem involves transferring liquid between containers to achieve a target state. We need to divide 8 litres of oil into two equal 4-litre quantities using 8L, 5L, and 3L bottles. Let's represent the capacities as (E, F, T) for 8L (Empty), 5L (Five), and 3L (Three) bottles. Initially, the 8L bottle is full, so (8,0,0). The goal is to get (4,4,0) or (4,0,4).
To divide the oil equally in the 8L bottle (resulting in 4 litres in the 8L bottle and 4 litres in the 5L bottle, so (4,4,0)), the following 7 steps are needed:
- Initial state: E,F,T = (8,0,0)
- Pour 5L of oil into the second (5L) bottle: (3,5,0)
- Pour 3L from the second (5L) bottle to the third (3L) bottle: (3,2,3)
- Pour 3L from the third (3L) bottle to the first (8L) bottle: (6,2,0)
- Pour all 2L from the second (5L) bottle to the third (3L) bottle: (6,0,2)
- Pour 5L from the first (8L) bottle to the second (5L) bottle: (1,5,2)
- Pour 1 L from the second (5L) bottle to the third (3L) bottle: (1,4,3)
- Finally, pour now all 3L from the third (3L) bottle to the first (8L) bottle: (4,4,0)
The state can be represented by a tuple (Amount in 8L bottle, Amount in 5L bottle, Amount in 3L bottle).
Initial State: (8, 0, 0)
Final State: (4, 4, 0) or (4, 0, 4)
Assignment statements as follows:
- (E,F,T) = (8,0,0) // Start with 8L bottle full
- (E,F,T) = (3,5,0) // Pour 5L from 8L to 5L
- (E,F,T) = (3,2,3) // Pour 3L from 5L to 3L
- (E,F,T) = (6,2,0) // Empty 3L into 8L
- (E,F,T) = (6,0,2) // Pour remaining 2L from 5L into 3L
- (E,F,T) = (1,5,2) // Fill 5L from 8L
- (E,F,T) = (1,4,3) // Pour 1L from 5L into 3L (3L bottle becomes full)
- (E,F,T) = (4,4,0) // Empty 3L into 8L (8L now has 4L, 5L has 4L)
In simple words: This puzzle is about splitting 8 litres of oil exactly in half using three bottles. You start with all oil in the 8L bottle. By carefully pouring oil between the bottles in a specific order, you can eventually get 4 litres in one bottle and 4 litres in another. It's like a game of moving liquids.
๐ฏ Exam Tip: For decanting problems, clearly define the state representation (e.g., (A, B, C)) and meticulously track the quantity of liquid in each container at every step to ensure accuracy.
Question 4. Trace the step-by-step execution of the algorithm for factorial(4).
Answer: To trace the factorial calculation, we follow the steps of a loop that multiplies numbers from 1 up to 'n'. For `factorial(4)`, we aim to calculate \( 4! = 4 \times 3 \times 2 \times 1 = 24 \). The algorithm needs to consider the base case where \( n=0 \) or \( n=1 \), but here it starts from \( i=1 \).
factorial(n)
- inputs: \( i \) is an integer, \( n > 0 \)
- outputs: \( f \) is \( n! \)
Initial: \( f, i := 1,1 \)
while \( i \leq n \)
\( f,i = f \times i, i+1 \)
Tracing steps for \( n=4 \):
i) Initial: \( f = 1, i = 1 \). Condition \( 1 \leq 4 \) is true.
ii) Loop 1: \( f = 1 \times 1 = 1 \), \( i = 1 + 1 = 2 \). Condition \( 2 \leq 4 \) is true.
iii) Loop 2: \( f = 1 \times 2 = 2 \), \( i = 2 + 1 = 3 \). Condition \( 3 \leq 4 \) is true.
iv) Loop 3: \( f = 2 \times 3 = 6 \), \( i = 3 + 1 = 4 \). Condition \( 4 \leq 4 \) is true.
v) Loop 4: \( f = 6 \times 4 = 24 \), \( i = 4 + 1 = 5 \). Condition \( 5 \leq 4 \) is false.
vi) The condition \( i \leq n \) (which is \( 5 \leq 4 \)) becomes false. The loop stops.
vii) Display output \( f \) value as 24.
The provided source trace for `factorial(5)` seems to have a typo, as the question asks for `factorial(4)`. I will correct the trace to `factorial(4)` as per the question and show the correct output. The given trace in the source also incorrectly shows `f,i = 11 = f x i, i+1` which should be `f := f * i, i := i + 1`. The provided OCR has `factorial(5)` as a heading and `vi) f = 24 x 5, i = 6` on the next page, but `factorial(4)` is explicitly mentioned in the question text.
In simple words: To find the factorial of 4, you start with 1 and multiply it by 1, then 2, then 3, and finally 4. Each step, you increase the number you are multiplying by until you reach 4. The final answer is 24.
๐ฏ Exam Tip: Always pay attention to the exact number given in the question for tracing. Ensure the loop condition is correctly evaluated at each step to determine when the loop should terminate.
11th Computer Science Guide Composition and Decomposition Additional Questions and Answers
Part I
Choose the correct answer:
Question 1. Which one of the following is odd?
(a) Python
(b) C++
(c) C
(d) Ctrl + S
Answer: (d) Ctrl + S
In simple words: Python, C++, and C are all computer programming languages. Ctrl + S is a keyboard shortcut used to save something, so it is different from the others.
๐ฏ Exam Tip: This question tests basic computer literacy and knowledge of common programming languages. "Ctrl + S" is a common keyboard shortcut for "save" in many applications.
Question 2. __________ is a notation for representing algorithms.
(a) programming language
(b) pseudo code
(c) flow chart
(d) All of the options
Answer: (d) All of the options
In simple words: Algorithms can be shown using different methods. You can write them using a programming language, in a simplified 'pseudo code', or draw them as a 'flow chart'. All these ways help to show how an algorithm works.
๐ฏ Exam Tip: Algorithms can be represented in various forms. Programming languages provide executable instructions, pseudocode offers a high-level description, and flowcharts give a visual representation.
Question 3. There are __________ important control flow statements.
(a) four
(b) three
(c) two
(d) five
Answer: (b) three
In simple words: There are three main types of control flow statements that guide how a program runs: sequential, alternative (decision-making), and iterative (looping). These basic structures help control the order of operations.
๐ฏ Exam Tip: Remember the three fundamental control flow statements: sequential, alternative (selection), and iterative (repetition/looping).
Question 4. __________ is a notation similar to programming languages.
(a) programming language
(b) pseudo code
(c) flow chart
(d) none of these
Answer: (b) pseudo code
In simple words: Pseudocode looks a lot like a real programming language, but it's simpler and doesn't follow strict rules. It's used to plan out code before actually writing it.
๐ฏ Exam Tip: Pseudocode uses plain language structures combined with programming constructs, making it an informal yet structured way to describe algorithms without language-specific syntax.
Question 5. A __________ is contained in a rectangular box with a single outgoing arrow, which points to the box to be executed next.
(a) statement
(b) composition
(c) notation
(d) condition
Answer: (a) statement
In simple words: In a flowchart, a rectangle with one arrow pointing out shows a single command or action that the computer will do. It represents a step in the process.
๐ฏ Exam Tip: In flowcharts, rectangular boxes are used for processing steps or statements, and they typically have one outgoing flow arrow.
Question 6. _____ is a diagrammatic notation for representing algorithms.
(a) programming language
(b) pseudo code
(c) flow chart
(d) none of these
Answer: (c) flow chart
In simple words: A flowchart is a way to show steps in a process using pictures and arrows.
๐ฏ Exam Tip: Remember that a flowchart gives a visual overview of an algorithm, making it easy to understand the sequence of operations.
Question 7. The algorithm can be specified as ..................................
(a) monochromatize (a, b, c)
(b) a = b = 0
(c) C = A + B + C
(d) none
Answer: (a) monochromatize (a, b, c)
In simple words: An algorithm's steps can be clearly defined or "specified" by stating what it does, like the monochromatize function. This helps in understanding its purpose before writing code.
๐ฏ Exam Tip: Specification clearly outlines what an algorithm should achieve, including its inputs and expected outputs, which is crucial before implementation.
Question 8. An algorithm expressed in a _____ is called a program.
a) programming language
b) pseudo code
c) flow chart
d) none of these
Answer: (a) programming language
In simple words: When an algorithm is written using specific rules that a computer understands, it is called a program. This helps the computer run the instructions.
๐ฏ Exam Tip: A program is the concrete implementation of an algorithm, written in a specific programming language that a computer can execute.
Question 9. Which one of the following is the elementary problem-solving technique?
(a) Specification
(b) Abstraction
(c) Composition
(d) decomposition
Answer: (d) decomposition
In simple words: Breaking down a big problem into smaller, simpler parts is called decomposition. This makes complex tasks easier to manage and solve.
๐ฏ Exam Tip: Decomposition is a fundamental problem-solving strategy, making complex problems more manageable by breaking them into smaller, independent subproblems.
Question 10. _____ is formal.
a) programming language
b) pseudo code
c) flow chart
d) none of these
Answer: (a) programming language
In simple words: Programming languages have strict rules for how you write code, making them formal. This ensures computers can correctly understand and run the instructions.
๐ฏ Exam Tip: Formal languages have a precisely defined syntax and semantics, which is necessary for clear communication with computers.
Question 11. How many different notations are there for representing algorithms?
(a) 2
(b) 3
(c) 4
(d) 5
Answer: (b) 3
In simple words: There are three main ways to write down algorithms: using normal language (like English), using pseudocode (which mixes normal language with programming terms), and using flowcharts (pictures). Each method helps to plan and explain how a problem will be solved.
๐ฏ Exam Tip: The three primary notations are natural language, pseudocode, and flowcharts, each serving different purposes in algorithm design and communication.
Question 12. _____ do not allow the informal style of natural languages such as English or Tamil.
a) programs
b) pseudo code
c) flow charts
d) none of these
Answer: (a) programs
In simple words: Programs use very strict rules and syntax, unlike everyday language. This strictness ensures the computer can understand and execute them exactly as intended.
๐ฏ Exam Tip: Programming languages demand precision in syntax and semantics because computers lack the ability to interpret ambiguity or context found in natural languages.
Question 13. Which one of the following algorithmic notations is used for communication among people?
(a) Flow chart
(b) Pseudo code
(c) PL
(d) Interpreter
Answer: (b) Pseudo code
In simple words: Pseudocode uses a mix of normal words and programming ideas, making it easy for people to understand and share how an algorithm works without needing a computer. It's a bridge between human language and programming language.
๐ฏ Exam Tip: Pseudocode is excellent for team collaboration and conceptualizing algorithms because it's human-readable and doesn't require strict adherence to a specific programming language's syntax.
Question 14. _____ notation is not formal nor exact.
a) programs
b) pseudo code
c) flow charts
d) none of these
Answer: (b) pseudo code
In simple words: Pseudocode is not as strict as a programming language or a flowchart. It allows for some flexibility in how you write it, focusing on ideas rather than exact rules.
๐ฏ Exam Tip: Pseudocode prioritizes clarity of logic over strict syntactic rules, making it a flexible tool for algorithm design.
Question 15. The algorithmic notation similar to a Programming language is ..................................
(a) Flow chart
(b) Pseudo code
(c) C ++
(d) C
Answer: (b) Pseudo code
In simple words: Pseudocode looks a bit like real computer code but uses more common words. It helps people plan their program steps before writing the actual code.
๐ฏ Exam Tip: Pseudocode borrows control structures (like IF, WHILE, FOR) from programming languages, giving it a code-like appearance without being executable.
Question 16. In _____ there is no need to follow the rules of the grammar of a programming language.
a) programs
b) pseudo code
c) flow charts
d) none of these
Answer: (b) pseudo code
In simple words: With pseudocode, you don't have to worry about every tiny grammar rule like in a real programming language. You can focus on the steps of the algorithm.
๐ฏ Exam Tip: Pseudocode's flexibility in syntax allows developers to concentrate solely on the algorithm's logic, simplifying the initial design phase.
Question 17. Which one is used for converting programs into computer-executable instructions?
(a) Converter
(b) Apps
(c) Translator
(d) exe files
Answer: (c) Translator
In simple words: A translator changes the code written by a person into a language that a computer can run directly. This is like a language expert helping two people who speak different languages understand each other.
๐ฏ Exam Tip: Translators, like compilers or interpreters, are crucial software that bridges the gap between human-readable code and machine-executable instructions.
Question 18. _____ show the control flow of algorithms using diagrams in a visual manner.
a) programs
b) pseudo code
c) flow charts
d) none of these
Answer: (c) flow charts
In simple words: Flowcharts use drawings and arrows to show the order of steps in an algorithm. This visual way helps people easily see how a process flows.
๐ฏ Exam Tip: Flowcharts are particularly effective for visualizing the sequence and decision points within an algorithm, aiding in understanding complex logic.
Question 19. The notation which is not formal nor exact is ..................................
(a) Flow chart
(b) Pseudocode
(c) Compiler
(d) Translator
Answer: (b) Pseudocode
In simple words: Pseudocode uses a blend of natural language and programming constructs, meaning it's less formal and exact than a real programming language. This makes it easier to read and understand for humans.
๐ฏ Exam Tip: Pseudocode focuses on algorithmic logic rather than strict syntax, making it an informal yet effective design tool.
Question 20. In flowcharts, _____ boxes represent conditions.
a) arrows
b) diamond shaped
c) rectangular shaped
d) none of these
Answer: (b) diamond shaped
In simple words: In a flowchart, a diamond shape is used to ask a "yes" or "no" question, which helps decide what happens next. This shape always shows a decision point in the process.
๐ฏ Exam Tip: Properly using diamond shapes for conditions and decisions is crucial for accurately representing branching logic in flowcharts.
Question 21. Find the pair which is wrongly matched.
(a) Rectangular boxes - Statements
(b) Diamond boxes - Output
(c) Arrow - Control flow
(d) Parallelogram - Input
Answer: (b) Diamond boxes - Output
In simple words: In flowcharts, diamond shapes are for decisions, not for showing results or outputs. Outputs are usually shown in parallelogram shapes.
๐ฏ Exam Tip: Know the standard flowchart symbols: rectangles for processes, diamonds for decisions, parallelograms for input/output, and ovals for start/end.
Question 22. A condition is contained in a diamond-shaped box with _____ outgoing arrows.
a) two
b) three
c) one
d) many
Answer: (a) two
In simple words: A diamond-shaped box in a flowchart shows a decision. From this box, there are always two paths, one for when the condition is true, and one for when it is false.
๐ฏ Exam Tip: Every decision point in a flowchart must have exactly two outgoing paths, representing the true and false outcomes of the condition.
Question 23. The inputs and outputs are drawn using _____ boxes.
(a) rectangular
(b) diamond
(c) Parallelogram
(d) Oval
Answer: (c) Parallelogram
In simple words: In flowcharts, parallelogram shapes are used to show when information is being put into the system or when results are coming out. This symbol clearly marks where data enters or exits.
๐ฏ Exam Tip: Correctly identifying input/output operations with parallelograms helps ensure data flow is clearly represented in a flowchart.
Question 24. In flow chart, _____ marked Start and the End are used to indicate the start and the end of an execution:
a) special box (oval)
b) diamond shaped
c) rectangular shaped
d) parallelogram
Answer: (a) special box (oval)
In simple words: Oval shapes in a flowchart always mark the very beginning ("Start") and the very end ("End") of a process. This helps clearly define the boundaries of the algorithm.
๐ฏ Exam Tip: The terminal symbol (oval) is crucial for defining the clear start and end points of any algorithm represented in a flowchart.
Question 25. The flow of control is represented in the flowchart by ..................................
(a) arrow
(b) dot
(c) box
(d) plus
Answer: (a) arrow
In simple words: Arrows in a flowchart show the direction of the process, guiding you from one step to the next. They are crucial for understanding the sequence of operations.
๐ฏ Exam Tip: Arrows indicate the sequence of execution, ensuring a logical and unambiguous flow from one step to the next in the algorithm.
Question 26. A _____ is a phrase that commands the computer to do an action.
a) statement
b) sentence
c) walkthrough
d) none of these
Answer: (a) statement
In simple words: A statement is like a command given to the computer, telling it to perform a specific action. For example, "print this message" is a statement.
๐ฏ Exam Tip: Statements form the building blocks of programs, each performing a single, defined action or operation.
Question 27. A condition is contained in a diamond-shaped box with _____ outgoing arrows.
(a) 2
(b) 3
(c) 4
(d) 5
Answer: (a) 2
In simple words: When you make a decision in a flowchart (shown by a diamond), there are always two possible outcomes or paths. One path is for when the condition is true, and the other is for when it is false.
๐ฏ Exam Tip: A diamond symbol in a flowchart always represents a binary decision, leading to exactly two possible subsequent paths.
Question 28. Statements composed of other statements are known as _____ statements.
a) compound
b) bock
c) nested
d) none of these
Answer: (a) compound
In simple words: When several statements are grouped together to perform a bigger task, they are called compound statements. This helps organize complex algorithms into smaller, reusable blocks.
๐ฏ Exam Tip: Compound statements, often enclosed in blocks (like curly braces), allow multiple actions to be treated as a single unit within control flow structures.
Question 29. _____ statement are compound statements.
a) input
b) output
c) comment
d) control flow
Answer: (d) control flow
In simple words: Control flow statements decide the order in which other statements are executed. They include things like if-else statements or loops, which combine smaller actions into a larger sequence.
๐ฏ Exam Tip: Control flow statements (sequential, alternative, iterative) are fundamental compound statements that direct the execution path of a program.
Question 30. How many outgoing arrows are needed for rectangular boxes in the flow chart?
(a) 0
(b) 1
(c) 2
(d) 3
Answer: (b) 1
In simple words: A rectangular box in a flowchart represents a simple action or process step. Since an action usually leads to only one next step, it needs just one outgoing arrow.
๐ฏ Exam Tip: Process symbols (rectangles) in flowcharts typically have a single output arrow, indicating a linear progression to the next step.
Question 31. _____ is a control flow statements.
a) Sequential
b) Alternative
c) Iterative
d) All the options
Answer: (d) All of the options
In simple words: Sequential, Alternative (if-else), and Iterative (loops) are all basic ways to control the order of steps in an algorithm. These are fundamental for structuring any program.
๐ฏ Exam Tip: Understand that sequential, alternative, and iterative structures are the three core types of control flow statements used in programming.
Question 32. Which one of the following is not a control flow statement?
(a) Sequential
(b) Assignment
(c) Iterative
(d) Alternative
Answer: (b) Assignment
In simple words: Assignment statements simply give a value to a variable, like \( x = 5 \). They don't change the order of execution, unlike sequential, iterative, or alternative statements which manage the flow.
๐ฏ Exam Tip: Control flow statements dictate the order of operations, while assignment statements merely update data without altering the execution path.
Question 33. Case analysis splits the problem into an exhaustive set of _____ cases.
a) disjoint
b) similar
c) recursive
d) none of these
Answer: (a) disjoint
In simple words: Case analysis breaks a problem into parts where each part is completely separate from the others. This means a situation will only fit into one specific case.
๐ฏ Exam Tip: The key characteristic of case analysis is that the cases must be both exhaustive (cover all possibilities) and disjoint (no overlap between cases).
Question 34. Which one of the following statements are executed one after the other as written in the algorithm?
(a) Sequential
(b) Iterative
(c) Conditional
(d) Decisive
Answer: (a) Sequential
In simple words: Sequential statements are like a recipe where you follow one step after another in the exact order they are written. There are no jumps or repeats; it's a straight path from start to finish.
๐ฏ Exam Tip: Sequential execution is the simplest control flow, where instructions are performed in the exact order they appear in the program.
Question 35. An _____ executes the same action repeatedly, subject to a condition.
a) iterative process
b) condition
c) sequential
d) None of these
Answer: (a) iterative process
In simple words: An iterative process keeps repeating the same actions until a certain condition is met. This is often used for tasks that need to be done many times, like counting.
๐ฏ Exam Tip: Iterative processes are implemented using loops (e.g., while, for) and are fundamental for tasks requiring repetition.
Question 36. Case analysis statement generalizes the statement into _____ cases.
(a) 2
(b) 3
(c) 5
(d) multiple
Answer: (d) multiple
In simple words: Case analysis allows you to handle many different situations or scenarios within a problem. This is why it can split a problem into multiple distinct cases.
๐ฏ Exam Tip: Case analysis extends simple if-else structures to handle more than two distinct conditions, often using constructs like switch or multi-level if-else if.
Question 37. Testing the loop condition and executing the, loop body once is called.
a) iteration
b) condition
c) sequential
d) none of these
Answer: (a) iteration
In simple words: When a loop checks its condition and then runs its main block of code once, that whole cycle is called an iteration. This is one step in a repeating process.
๐ฏ Exam Tip: Each complete cycle of a loop, including the condition check and body execution, is termed an iteration.
Question 38. Which one of the following processes executes the same action repeatedly?
(a) Conditional
(b) Alternative
(c) Iterative
(d) None of these
Answer: (c) Iterative
In simple words: Iterative processes involve repeating a set of instructions over and over again until a specific condition is met. This is fundamental for tasks that require repetitive actions, like counting or searching.
๐ฏ Exam Tip: Recognize that "iterative" directly implies repetition, which is handled in programming through loops.
Question 39. _____ breaking and combining the solutions of the smaller problems to solve the original problem.
a) Composition
b) Decomposition
c) Eliminating
d) None of these
Answer: (b) Decomposition
In simple words: Decomposition means taking a large problem and breaking it down into smaller, simpler parts. You solve these small parts and then put their solutions together to solve the original big problem.
๐ฏ Exam Tip: Decomposition is a powerful strategy, often paired with composition, where individual solutions are combined to address the larger problem effectively.
Question 40. Testing the loop condition and executing the loop body once is called _____
(a) alternative
(b) conditional
(c) Iteration
(d) Decomposition
Answer: (c) Iteration
In simple words: An iteration is one complete cycle where a loop checks its condition and then runs its main set of instructions. This is a key step in any repeating process.
๐ฏ Exam Tip: Clearly distinguish between a "loop" (the structure) and an "iteration" (a single execution cycle of that loop).
Question 41. A(n) _____ is like a sub-algorithm.
a) function
b) array
c) structure
d) None of these
Answer: (a) function
In simple words: A function is a small, independent block of code that does a specific task. It can be thought of as a mini-algorithm within a larger algorithm, helping to organize the code.
๐ฏ Exam Tip: Functions promote modularity and reusability, essential principles in good programming practice.
Question 42. A _____ can be used as a black box in solving other problems.
a) function
b) array
c) structure
d) None of these
Answer: (a) function
In simple words: A function can be treated like a "black box" because you only need to know what it does, not how it does it, when solving other problems. This simplifies thinking about complex systems.
๐ฏ Exam Tip: The "black box" concept for functions highlights abstraction, where internal complexity is hidden, and only the interface is relevant to the user.
Question 43. Identify the correct statement from the following.
a) There is no need for the users to know how the function is implemented in order to use it.
b) An algorithm used to implement a function may maintain its own variables.
c) users of the function need only to know what the function does, and not how it is done by the function.
d) All the options
Answer: (d) All of the options
In simple words: Functions are designed so users don't need to know their internal details, just what they achieve. They can also use their own temporary variables, and focus on the purpose, not the specific implementation. This makes functions very useful for organizing code and keeping it simple.
๐ฏ Exam Tip: These points collectively describe the benefits of abstraction and encapsulation when using functions in programming.
Question 44. Conditional statement is executed only if the condition is true. Otherwise, _____
a) terminates the algorithm
b) repeat the procedure
c) skip the loop
d) nothing is done
Answer: (d) nothing is done
In simple words: If a conditional statement's condition is false, the code inside the 'if' part is skipped, and nothing specific is executed. The program just moves on to the next instruction after the conditional block.
๐ฏ Exam Tip: For a simple 'if' statement without an 'else' clause, a false condition means the guarded block of code is entirely bypassed.
Short Answers
Question 1. What is programming language?
Answer: A programming language is a special way to write instructions that computers can understand and follow. It helps us tell the computer what to do. These languages have strict rules to ensure the computer interprets the commands correctly.
In simple words: A programming language is a set of rules and symbols used to write instructions for computers.
๐ฏ Exam Tip: Define a programming language as a formal notation for algorithms meant for computer execution, highlighting its strict syntax.
Question 2. What is a Pseudocode?
Answer: Pseudocode combines ideas from programming languages with simple English words. It's written so people can easily read and understand the steps of an algorithm, not for computers to run directly. It acts as a planning tool, allowing developers to design logic before writing actual code.
In simple words: Pseudocode is a simple way to describe an algorithm using everyday language mixed with programming terms, for people to understand.
๐ฏ Exam Tip: Emphasize that pseudocode is a human-readable, informal description of an algorithm, serving as a bridge between natural language and programming code.
Question 3. What is flowchart?
Answer: A flowchart is a way to show algorithms using diagrams. It helps us see clearly, with pictures, how a program will move from one step to the next when it runs. Different shapes represent different types of steps, making the process easy to follow visually.
In simple words: A flowchart uses diagrams and symbols to show the step-by-step process of an algorithm.
๐ฏ Exam Tip: When defining a flowchart, mention its visual nature and the use of standard symbols to represent operations and control flow.
Question 4. What is a control flow statement? Classify it.
Answer: Control flow statements are special types of statements that change the order in which a program runs. They decide which parts of the code should be executed next, based on certain conditions or how the program is doing. These are mainly grouped into three types:
1. Sequential (steps follow one after another)
2. Alternative (choose between different paths, like 'if-else')
3. Iterative (repeat steps, like 'loops')
These structures are essential for creating dynamic and responsive programs.
In simple words: Control flow statements manage the order of execution in a program. They are classified as Sequential, Alternative (decision-making), and Iterative (repetition).
๐ฏ Exam Tip: Clearly state that control flow statements dictate the order of instruction execution and list the three primary classifications with a brief description of each.
Question 5. What are the constraints of a programming language?
Answer: Here are the limitations of programming languages:
- They are very strict and formal.
- Programs must follow the rules of the language's grammar precisely, down to every tiny symbol like a comma or semicolon.
- They cannot understand the casual or flexible way we use everyday languages like English or Tamil.
In simple words: Programming languages are strict, require exact grammar and punctuation, and cannot understand informal human language.
๐ฏ Exam Tip: Focus on formality, strict adherence to syntax (grammar and punctuation), and the lack of natural language understanding as key constraints of programming languages.
Question 6. When a condition statement will be executed?
Answer: A conditional statement will only run its set of instructions if the specific condition it checks turns out to be true. If the condition is false, those instructions are skipped. This allows programs to make decisions and behave differently based on various inputs or situations.
In simple words: A conditional statement runs only when its condition is true; otherwise, it is skipped.
๐ฏ Exam Tip: Highlight that conditional statements' execution is dependent on the truth value of their associated condition, enabling decision-making in algorithms.
Question 7. What is the advantage of a flowchart?
Answer: Flowcharts are good because they show how an algorithm works using pictures. This visual representation makes it easy to understand the steps and their order. This visual clarity helps in identifying logical errors or optimizing the process before coding.
In simple words: Flowcharts provide a visual way to understand an algorithm's steps and control flow, making it easier to follow.
๐ฏ Exam Tip: The main advantage of flowcharts is their visual clarity, which helps in quickly grasping complex logic and identifying potential issues.
Question 8. What is a statement?
Answer: A statement is a clear instruction given to a computer that tells it to perform a specific action. Each statement acts like a single command you give to the computer.
In simple words: A statement is a command that makes the computer do something.
๐ฏ Exam Tip: Remember that statements are the building blocks of any program, forming the individual steps of an algorithm.
Question 9. What do you mean by compound statement?
Answer: A compound statement is made up of several smaller statements grouped together. This grouping helps to create a more organized, hierarchical structure in algorithms. Think of it like building blocks; you put smaller statements together to make a bigger one.
In simple words: A compound statement combines smaller statements into one larger unit.
๐ฏ Exam Tip: Understanding compound statements is key to writing structured and complex algorithms, as they allow for organization and logical grouping of actions.
Question 10. What are the control flow statements?
Answer: Control flow statements are special types of statements that change the order in which a program's instructions are executed. These statements decide the order in which a program's instructions are carried out. They are mainly classified into three important types:
- Sequential
- Alternative
- Iterative
In simple words: Control flow statements guide the computer on which instruction to run next, and there are three main kinds: sequential, alternative, and iterative.
๐ฏ Exam Tip: These three types of control flow statements (sequential, alternative, iterative) are fundamental to all programming languages.
Question 11. What happen when a control flow statement is executed?
Answer: When a control flow statement is executed, the program first checks a certain condition or the current state of the process. Based on this check, it then chooses which specific statement or block of statements to run next. This allows programs to make choices or repeat tasks based on certain conditions.
In simple words: When a control flow statement runs, it checks something and then decides which part of the program to execute next.
๐ฏ Exam Tip: Focus on the "test condition" and "select statement" aspects as the core functions of control flow execution.
Question 12. Write the specification for finding minimum of two numbers.
Answer: The specification for finding the minimum of two numbers, say 'a' and 'b', describes what the function will do without explaining how. This specification helps developers clearly understand what the function should do before writing the actual code.
Specification: `minimum(a, b)`
- Inputs: `a`, `b` (any two numbers)
- Outputs: `result` (the smaller of `a` and `b`, represented as \( a \downarrow b \))
In simple words: To find the minimum of two numbers, you tell the program what numbers it will get (inputs) and what it should give back (output - the smaller number).
๐ฏ Exam Tip: A good specification clearly states inputs, outputs, and any constraints, making the problem definition unambiguous for algorithm design.
Part III
Explain In Brief
Question 1. How many notations are there for representing algorithms? Explain.
Answer: There are mainly three different ways to represent algorithms. Each notation has its own strengths, making it suitable for different situations or audiences.
- Programming Language: This is a formal way to write algorithms so that computers can understand and execute them directly.
- Pseudocode: This is a mix of natural language (like English) and programming language structures. It is used for people to understand algorithms easily, not for computers to run.
- Flowchart: This is a visual way to show algorithms using diagrams. It provides a clear, step-by-step picture of how an algorithm works and how the control flows.
In simple words: Algorithms can be shown in three ways: programming languages for computers, pseudocode for people to read, and flowcharts for a visual step-by-step picture.
๐ฏ Exam Tip: When asked to explain different notations, remember to mention who each notation is primarily for (computers, people, or visual clarity).
Question 2. What are the disadvantages of a flowchart?
Answer: Flowcharts, while helpful, have some drawbacks:
- Less Compact: They take up more space compared to writing algorithms in a programming language or pseudocode. For very complex algorithms, flowcharts can become quite large and hard to manage.
- Hides Structure: They don't always clearly show the main, overall structure of the algorithm, which can be important for understanding complex logic.
- Rigid Control Flow: Standard flowcharts sometimes struggle to represent modern, structured programming concepts like alternative statements and loops in the most efficient way.
In simple words: Flowcharts can be large, hide the main structure of an algorithm, and aren't always the best for showing modern programming ideas.
๐ฏ Exam Tip: When discussing disadvantages, focus on issues related to scale (compactness), clarity (structure), and modern programming practices.
Question 3. Write a note on refinement.
Answer: After breaking a big problem into smaller pieces (subproblems), the next step is either to refine these subproblems or to make them more abstract. Refinement helps to manage complexity by allowing us to focus on details gradually.
- Detailed Expansion: Refinement means breaking each subproblem into even smaller, more detailed steps. Each of these new steps can then be broken down further, and so on, until the steps are very clear and easy to understand.
- Abstraction: This involves defining each subproblem by what it needs (its inputs) and what it should produce (its outputs). When solving the main problem, we only need to know what each subproblem does, not exactly how it does it.
In simple words: Refinement means breaking down parts of a problem into smaller, more specific steps, or defining what each part should do without explaining how.
๐ฏ Exam Tip: Refinement is a top-down approach that helps in detailed planning, while abstraction is more about defining clear interfaces for subproblems.
Question 4. Write an algorithm that compares numbers and produces the result as follows:
\( \text{compare}(a, b) = \)
\( \begin{cases} -1 & \text{if } a < b \\ 0 & \text{if } a = b \\ 1 & \text{if } a > b \end{cases} \)
Answer: To create an algorithm that compares two numbers 'a' and 'b' and produces the specified result, we can use a case analysis approach. This method of comparing numbers is fundamental in many sorting and decision-making algorithms.
The algorithm splits the problem into three distinct scenarios:
1. `compare(a, b)`
2. `case a < b:`
3. `result := -1`
4. `case a = b:`
5. `result := 0`
6. `else -- a > b:`
7. `result := 1`
In simple words: The algorithm checks if 'a' is smaller than 'b', equal to 'b', or larger than 'b'. It then gives a specific number (-1, 0, or 1) based on that comparison.
๐ฏ Exam Tip: Case analysis provides a clear, structured way to handle different outcomes based on specific conditions, ensuring all possibilities are covered.
Question 5. Construct specification and write an iterative algorithm to compute the quotient and remainder after dividing an integer A by another integer B.
Answer: This iterative method mimics how we perform long division by repeatedly subtracting the divisor.
Specification: `divide(A, B)`
- Inputs: `A` (an integer), `B` (an integer, not zero)
- Outputs: `q` (quotient) and `r` (remainder) such that \( A = q \times B + r \) and \( 0 \le r < B \)
Algorithm:
`divide(A, B)`
- Inputs: `A` (an integer), `B` (an integer, not zero)
- Outputs: `q` (quotient) and `r` (remainder) such that \( A = q \times B + r \) and \( 0 \le r < B \)
`q := 0, r := A` (Initialize quotient to 0, remainder to A)
`while r >= B do`
`q := q + 1`
`r := r - B`
`end while`
In simple words: First, you define what numbers go in (A and B) and what numbers come out (quotient and remainder). Then, the algorithm repeatedly subtracts B from A and counts how many times it can do that, which gives the quotient, and what's left is the remainder.
๐ฏ Exam Tip: When writing specifications, always clearly state inputs, outputs, and any mathematical relationships or constraints between them.
Question 6. Explain Decomposition.
Answer: Decomposition is a problem-solving strategy where a large, complex problem is broken down into smaller, simpler, and more manageable parts. This strategy is very useful for tackling complex challenges by dealing with one small part at a time.
The process involves:
- First, dividing the main problem into smaller, individual problems.
- Then, if needed, these smaller problems can be further divided until each piece is simple enough to be solved easily.
- Finally, the solutions to all these small problems are put back together to create the full solution for the original complex problem.
In simple words: Decomposition means breaking a big problem into many small ones, solving each small part, and then putting the small solutions together to fix the big problem.
๐ฏ Exam Tip: Decomposition is a core concept in computer science, also known as "divide and conquer," and is essential for managing complexity in program design.
Question 7. Construct an iterative algorithm to compute the quotient and remainder after dividing an integer A by another integer B.
Answer: This fundamental algorithm is how computers perform division without using a direct division operator.
Specification: `divide(A, B)`
- Inputs: `A` (an integer), `B` (an integer, not zero)
- Outputs: `q` (quotient) and `r` (remainder) such that \( A = q \times B + r \) and \( 0 \le r < B \)
Algorithm:
`divide(A, B)`
- Inputs: `A` (an integer), `B` (an integer, not zero)
- Outputs: `q` (quotient) and `r` (remainder) such that \( A = q \times B + r \) and \( 0 \le r < B \)
`q := 0, r := A` (Initialize quotient to 0, remainder to A)
`while r >= B do`
`q := q + 1`
`r := r - B`
`end while`
In simple words: You first define what goes in (A and B) and what comes out (quotient and remainder). Then, the algorithm repeatedly subtracts B from A, counting the subtractions as the quotient, until A is smaller than B, which then becomes the remainder.
๐ฏ Exam Tip: Ensure your algorithm correctly handles edge cases like A being smaller than B initially, where the quotient would be 0 and the remainder would be A.
Question 8. Draw a flow chart for Eat breakfast.
Answer: Here is a flowchart representing the process of eating breakfast. This chart visually breaks down the steps and decisions involved in a morning meal routine.
In simple words: This chart shows a path from starting breakfast, checking for idlis, then eggs, then bananas, and finally exiting the process after eating or if no food is available.
๐ฏ Exam Tip: When drawing flowcharts, use standard symbols consistently: ovals for start/end, rectangles for processes, diamonds for decisions, and parallelograms for input/output.
Part IV
Explain In Detail
Question 1. What is flowchart? Explain the various boxes (symbols) used in flowchart.
Answer: A flowchart is a diagrammatic tool used to represent algorithms. It provides a visual and intuitive way to understand the flow of control within an algorithm as it executes. Flowcharts are a great visual tool to plan out program logic before writing any code.
Flowcharts use different standardized symbols, connected by arrows, to show various types of operations and decisions:
(i) Statement (Process) Box: A statement or process is shown inside a rectangular box. It has a single arrow leaving it, pointing to the next operation.
(ii) Condition (Decision) Box: A condition that needs to be checked (like a question with a "true" or "false" answer) is placed inside a diamond-shaped box. Two arrows leave this box: one labeled "true" (for when the condition is met) and another labeled "false" (for when it's not). These arrows point to the next steps.
(iii) Input/Output Box: Parallelogram-shaped boxes are used to show when data is being entered into the algorithm (input) or when results are being displayed (output).
(iv) Terminal (Start/End) Box: Special oval-shaped boxes are used to mark the beginning ("Start") and the end ("End") of an algorithm's execution.
In simple words: A flowchart uses shapes like rectangles for actions, diamonds for choices, parallelograms for showing data, and ovals for starting or ending, all connected by arrows to show how a computer program works.
๐ฏ Exam Tip: When drawing or explaining flowchart symbols, make sure to describe both the shape and its specific purpose, along with how arrows connect them.
Question 2. Draw a flowchart to compute the quotient and remainder after dividing an integer A by another integer B.
Answer: Here is a flowchart that outlines the steps to calculate the quotient and remainder when dividing an integer A by an integer B. This visual representation helps understand the iterative process involved.
In simple words: The flowchart starts, takes two numbers (A and B), sets quotient to zero and remainder to A, then repeatedly subtracts B from the remainder and increases the quotient until the remainder is smaller than B, and finally shows the result before ending.
๐ฏ Exam Tip: For iterative algorithms like division, clearly show the initialization, the loop condition, the body of the loop (updates to quotient and remainder), and the exit condition.
Question 3. Explain sequential statement with suitable example.
Answer: A sequential statement is a series of instructions that are executed one after another, exactly in the order they are written in the algorithm. This is the most basic way instructions are carried out, like following a recipe.
For example, if we have two statements, \(S_1\) and \(S_2\), a sequential statement would be written as \(S_1; S_2\). To execute this, the program first completes \(S_1\), and only then does it proceed to execute \(S_2\).
This sequential flow can be visualized in a flowchart as one process box leading directly to the next:
In simple words: A sequential statement means the computer does one thing, then the next thing, in a simple straight line, just like steps in a recipe.
๐ฏ Exam Tip: The key characteristic of a sequential statement is that there are no decisions or repetitions; instructions are followed strictly in order.
Question 4. Explain alternative statement with an example.
Answer: An alternative statement allows a program to choose between two different actions based on whether a condition is true or false. This kind of statement allows a program to choose between two different paths of action based on a check.
If `C` is a condition (a test that can be true or false) and \(S_1\) and \(S_2\) are statements, an alternative statement looks like: `if C then S1 else S2`.
The program will:
(i) First, check if condition `C` is true or false.
(ii) If `C` is true, it will execute statement \(S_1\). If `C` is false, it will execute statement \(S_2\).
This is shown in a flowchart with a diamond (for the condition) splitting into two paths (true and false), each leading to a different action, which then merge back together:
In simple words: An alternative statement lets a program choose one of two different actions depending on whether a condition is true or false.
๐ฏ Exam Tip: The crucial part of an alternative statement is the `if-else` structure, where exactly one of two distinct paths is taken.
Question 5. Explain conditional statement with suitable example.
Answer: A conditional statement is a special type of alternative statement where an action is taken only if a specific condition is true. If the condition is false, nothing is done; the program simply moves on. This is like an "if-then" rule without an "else" part. This is a fundamental concept in programming, often seen as an "if-then" structure without an "else".
If `C` is a condition and `S` is a statement, a conditional statement looks like: `if C then S`.
The program will:
(i) First, check if condition `C` is true or false.
(ii) If `C` is true, it will execute statement `S`. If `C` is false, it will do nothing and proceed to the next part of the algorithm.
Here's how it looks in a flowchart:
In simple words: A conditional statement checks if something is true; if it is, an action happens, but if it's false, nothing happens, and the program just moves on.
๐ฏ Exam Tip: Distinguish conditional statements (if-then) from alternative statements (if-then-else) by the absence of an "else" action.
Question 6. Write a note on case analysis.
Answer: Case analysis is a problem-solving technique that extends the idea of an alternative statement to handle multiple possible situations. It splits a problem into an exhaustive set of disjoint cases, meaning that every possible input falls into exactly one case. This structured approach ensures that every possible input is covered and processed uniquely.
For each case, the problem is solved independently. For example, if we have conditions \(C_1, C_2, \text{and } C_3\) and statements \(S_1, S_2, S_3, \text{and } S_4\), a 4-case analysis structure would be:
1. `case C1:`
2. `S1`
3. `case C2:`
4. `S2`
5. `case C3:`
6. `S3`
7. `else:`
8. `S4`
The conditions \(C_1, C_2, \text{and } C_3\) are checked one by one. The first condition that evaluates to true will have its corresponding statement executed, and then the case analysis block ends. If none of the conditions are true, the default statement \(S_4\) (under `else`) is executed.
Key properties of cases in case analysis:
1. Exhaustive: At least one case must always be true. If all specified conditions are false, the default `else` case ensures a path is always taken.
2. Disjoint: Only one case is executed, even if multiple conditions might seem true. The algorithm executes the first condition that is found to be true.
3. If the three conditions \(C_1, C_2, \text{and } C_3\) are distinct, then the four possible outcomes (cases) are: `C1`, `C2`, `C3`, and `(not C1 AND not C2 AND not C3)`.
In simple words: Case analysis is like having many "if-else if" choices, where the program checks conditions one by one and performs the action for the first true condition, covering all possible situations clearly.
๐ฏ Exam Tip: Emphasize "exhaustive" (covers all possibilities) and "disjoint" (only one path taken) when describing case analysis, as these are its defining characteristics.
Question 7. Explain iterative statement with suitable example.
Answer: An iterative statement is a programming construct that allows a set of instructions to be executed repeatedly as long as a certain condition remains true. Iterative statements are commonly known as "loops." Loops are essential for tasks that need to be performed multiple times, such as counting or processing lists of items.
If `C` is a condition and `S` is a statement, an iterative statement typically looks like: `while C do S`.
The process involves:
- First, the condition `C` is tested to see if it is true or false.
- If `C` is true, statement `S` is executed. After `S` is finished, the program goes back to step 1 and tests `C` again.
- If `C` is false, the loop ends, and the program moves on to the statement immediately following the loop.
This iterative control flow can be illustrated by the following flowchart:
In simple words: An iterative statement (or loop) makes the computer repeat an action again and again, as long as a certain condition stays true. Once the condition becomes false, the repetition stops.
๐ฏ Exam Tip: Always clearly state the loop condition and ensure the loop body contains actions that will eventually make the condition false, preventing infinite loops.
I have reviewed the content on page 43 as per your instructions. This page contains website navigation links ("Recent Posts") and footer elements ("About Us", "Privacy Policy", "Disclaimer", "Contact Us", Copyright information). As per the content processing rules (specifically "IGNORE AND SKIP โ FOOTER / NAVIGATION" and "IGNORE AND SKIP โ PAGE HEADER / SEO TITLES"), these elements are to be completely ignored as they are not educational content. Therefore, there is no content to convert to HTML from page 43.Free study material for Computer Science
TN Board Solutions Class 11 Computer Science Chapter 07 Composition and Decomposition
Students can now access the TN Board Solutions for Chapter 07 Composition and Decomposition prepared by teachers on our website. These solutions cover all questions in exercise in your Class 11 Computer Science textbook. Each answer is updated based on the current academic session as per the latest TN Board syllabus.
Detailed Explanations for Chapter 07 Composition and Decomposition
Our expert teachers have provided step-by-step explanations for all the difficult questions in the Class 11 Computer Science chapter. Along with the final answers, we have also explained the concept behind it to help you build stronger understanding of each topic. This will be really helpful for Class 11 students who want to understand both theoretical and practical questions. By studying these TN Board Questions and Answers your basic concepts will improve a lot.
Benefits of using Computer Science Class 11 Solved Papers
Using our Computer Science solutions regularly students will be able to improve their logical thinking and problem-solving speed. These Class 11 solutions are a guide for self-study and homework assistance. Along with the chapter-wise solutions, you should also refer to our Revision Notes and Sample Papers for Chapter 07 Composition and Decomposition to get a complete preparation experience.
FAQs
The complete and updated Samacheer Kalvi Class 11 Computer Science Solutions Chapter 7 Composition and Decomposition is available for free on StudiesToday.com. These solutions for Class 11 Computer Science are as per latest TN Board curriculum.
Yes, our experts have revised the Samacheer Kalvi Class 11 Computer Science Solutions Chapter 7 Composition and Decomposition as per 2026 exam pattern. All textbook exercises have been solved and have added explanation about how the Computer Science concepts are applied in case-study and assertion-reasoning questions.
Toppers recommend using TN Board language because TN Board marking schemes are strictly based on textbook definitions. Our Samacheer Kalvi Class 11 Computer Science Solutions Chapter 7 Composition and Decomposition will help students to get full marks in the theory paper.
Yes, we provide bilingual support for Class 11 Computer Science. You can access Samacheer Kalvi Class 11 Computer Science Solutions Chapter 7 Composition and Decomposition in both English and Hindi medium.
Yes, you can download the entire Samacheer Kalvi Class 11 Computer Science Solutions Chapter 7 Composition and Decomposition in printable PDF format for offline study on any device.