Quiz Space

Computational Thinking · Qualifier · 24 Mar 2024 · January 2024 term

Question 2: The following pseudocode is executed using the "Words" da…

Question 2

+4 marksOne correct option

The following pseudocode is executed using the "Words" dataset. At the end of the execution, count stores the number of pairs of nouns such that both nouns have either the same letter count or both end with a full stop. Choose the correct code fragment to complete the pseudocode.

text
1 count = 0
2 while(Table 1 has more rows){
3 Read the first row X in Table 1
4 Move X to Table 2
5 if(***Statement 1***){
6 while(Table 1 has more rows){
7 Read the first row Y in Table 1
8 Move Y to Table 3
9 if(***Statement 2***){
10 if(X.LetterCount == Y.LetterCount){
11 count = count + 1
12 }
13 else{
14 if(***Statement 3***){
15 count = count + 1
16 }
17 }
18 }
19 }
20 Move all rows from Table 3 to Table 1
21 }
22 }
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 2 of 14 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) Qualifier paper sat on 24 Mar 2024, in the January 2024 term (IIT M QUALIFIER AN EXAM QDQ1 24 Mar 2024). It carries 4 marks.

More questions from this paper

  1. Q1The given pseudocode is executed using the “Shopping Bills” dataset.frac stores the ratio of the number of customers wh…
  2. Q3The following pseudocode is executed using the “Scores” dataset. Assume that the variable AvgT holds the value of the a…
  3. Q4The following pseudocode is executed using the “Words” dataset. What will A represent at the end of the execution?
  4. Q5Procedure miniSum accepts three numbers as parameters and returns the sum of two smallest numbers.\ Choose the correct …
  5. Q6The following pseudocode is executed using the “Scores” dataset. What will count represent at the end of the execution?
  6. Q7The following pseudocode is executed using the “Olympics” dataset. Procedure doSomething accepts a table of rows that c…
  7. Q8The following pseudocode is executed using the “Library” dataset. What will B represent at the end of execution?
  8. Q9The following pseudocode is executed using the “Scores” dataset. What will A represent at the end of the execution?
  9. Q10The following pseudocode is executed using the “Words” dataset. What will count represent at the end of execution?
  10. Q11The given pseudocode is executed using the “Olympics” table. At the end of execution, count represent the number of pai…
  11. Q12The following pseudocode is executed using the "Scores" dataset. At the end of the execution of the below pseudocode, i…
  12. Q13The given information represents a "Library" dataset and it may have some mistakes with respect to the sanity of the da…
  13. Q14The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph.\…