Quiz Space

Computational Thinking · Qualifier · 22 Dec 2024 · September 2024 term

Question 2: The following pseudocode is executed using the "Scores" d…

Question 2

+4 marksOne correct option

The following pseudocode is executed using the "Scores" dataset. At the end of the execution of below pseudocode, if count2 represents the number of male students whose Physics marks are less than or equal to Mathematics marks, then select the correct code fragment for A and B.

text
1 count1 = 0, count2 = 0
2 while(Table 1 has more rows){
3 Read the first row X in Table 1
4 if(....A.... or ....B....){
5 count1 = count1 + 1
6 }
7 else{
8 count2 = count2 + 1
9 }
10 Move X to Table 2
11 }
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 2 of 12 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) Qualifier paper sat on 22 Dec 2024, in the September 2024 term (IIT M DS REATTEMPT AN EXAM QDQ1 22 Dec 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 w…
  2. Q3The following pseudocode is executed using the "Words" dataset. At the end of the execution, count stores the number of…
  3. Q4The following pseudocode is executed using the "Scores" dataset. Assume that the variable AvgT holds the value of the a…
  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 “Scores” dataset. What will A represent at the end of the execution?
  7. Q8The following pseudocode is executed using the “Olympics” dataset. Procedure doSomething accepts a table of rows that c…
  8. Q9The given pseudocode is executed using the “Olympics” table. At the end of execution, count represent the number of pai…
  9. Q10The following pseudocode is executed using the "Scores" dataset. At the end of the execution of the below pseudocode, i…
  10. Q11The given information represents a "Library" dataset and it may have some mistakes with respect to the sanity of the da…
  11. Q12The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph. …