Quiz Space

Computational Thinking · Qualifier · 16 Mar 2025 · January 2025 term

Question 7: The given pseudocode is executed using the “Olympics” tab…

Question 7

+5 marksOne correct option

The given pseudocode is executed using the “Olympics” table. What will count represent at the end of the execution? Assume all players have distinct names.

text
count = 0
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
while(Table 1 has more rows){
Read the first row Y in Table 1
Move Y to Table 3
if(X.Name != Y.Name){
if(X.Nationality == Y.Nationality and X.Medal == Y.Medal){
count = count + 1
}
}
}
Move all rows from Table 3 to Table 1
}
  1. A

    The number of pairs of players having the same nationality or the same medal.

  2. B

    The number of pairs of players having the same nationality and same medal.

  3. C

    The number of players having the same nationality and same medal.

  4. D

    The number of players having the different name but of same nationality.

Show answer

Correct answer

  • B

    The number of pairs of players having the same nationality and same medal.

Question 7 of 12 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) Qualifier paper sat on 16 Mar 2025, in the January 2025 term (IIT M QUALIFIER AN EXAM QDQ1 16 Mar 2025). It carries 5 marks.

More questions from this paper

  1. Q1Statement The following pseudocode is executed using the "Scores" dataset. At the end of the execution of below pseudoc…
  2. Q2The following pseudocode is executed using the "Words" table. At the end of the execution, count stores the number of p…
  3. Q3Statement The following pseudocode is executed using the “Scores” dataset. At the end of the execution, variable Count …
  4. Q4Statement The following pseudocode is executed using the “Words” dataset. What will A represent at the end of the execu…
  5. Q5Statement Procedure miniSum accepts three numbers as parameters and returns the sum of two smallest numbers. Choose the…
  6. Q6Statement The following pseudocode is executed using the “Scores” dataset. What will A represent at the end of the exec…
  7. Q8Let X and Y be two rows in the “Scores” table. We call X and Y partially matching if student X and Y are either from th…
  8. Q9Statement The given pseudocode is executed using the “Shopping Bills” dataset. frac stores the ratio of the number of c…
  9. Q10Statement The given information represents a "Words" dataset and it may have some mistakes with respect to the sanity o…
  10. Q11Statement The following pseudocode is executed using the “Scores” dataset. At the end of the execution, count captures …
  11. Q12The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph. …