Topic: Chapter 7: Composition and Decomposition



Topic: Chapter 7: Composition and Decomposition
Q.1
Parallelogram boxes represent 
A. Process
B. inputs given and outputs produced
C. Start and the End
D. statement
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.2
After decomposing a problem into smaller subproblems, the next step is
A. to refine the subproblem
B. to abstract the subproblem
C. either both above
D. none of above
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.3

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 : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.4
notations for expressing algorithms
A. Programming language
B. pseudo code
C. flowchart are notations
D. all the above
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.5

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 : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.6
The value of a condition is true or false, depending on
A. the values of the variables
B. the values of the file size
C. the numer of loops
D. all the above
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.7

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 : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.8
A function is like a
A. memory state
B. sub-algorithm
C. program file
D. all the above
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.9

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 : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.10
Case analysis splits the problem into an exhaustive set of
A. relative case
B. disjoint cases
C. any cases
D. no cases
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report