Quiz Space

Computational Thinking · Qualifier · 10 Jul 2022 · May 2022 term

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

Question 8

+3 marksOne or more correct options

The following pseudocode is executed using the "Words" dataset. At the end of the execution, C captures the number of nouns with letter count at least four and at most eight. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. It is a Multiple Select Question (MSQ).

text
1 C = 0
2 while(Table 1 has more rows){
3 Read the first row X from Table 1
4 if(CheckSomething(X, 4, 8)){
5 C = C + 1
6 }
7 Move X to Table 2
8 }
9 Procedure CheckSomething(Y, C1, C2)
10 if(Y.PartOfSpeech == "Noun"){
11 if(C1 <= Y.LetterCount and Y.LetterCount <= C2){
12 return(True)
13 }
14 else{
15 return(False)
16 }
17 }
18 else{
19 return(False)
20 }
21 End CheckSomething

Select all that apply.

  1. A

    Error in Line 1

  2. B

    Error in Line 4

  3. C

    Error in Line 5

  4. D

    Error in Line 10

  5. E

    Error in Line 11

  6. F

    Multiple return(False) in procedure CheckSomething

  7. G

    No error

Show answer

Correct answer

  • G

    No error

Question 8 of 14 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) Qualifier paper sat on 10 Jul 2022, in the May 2022 term (IIT M QUALIFIER EXAM QPA1 10 July 2022). It carries 3 marks.

More questions from this paper

  1. Q1The following pseudocode is executed using the "Words" dataset. What will A represent at the end of the execution?
  2. Q2The following pseudocode is executed using the "Words" dataset. At the end of the execution, A is set to True if there …
  3. Q3The following pseudocode is executed using the "Library" dataset. What will count represent at the end of the execution?
  4. Q4Let A be an author who has written a book in the "Library" dataset and B be a positive integer. What does the procedure…
  5. Q5The following pseudocode is executed using the "Words" dataset. What will count represent at the end of the execution?
  6. Q6miniSum accepts three distinct numbers as parameters and returns the sum of two smallest numbers. Choose the correct co…
  7. Q7The following pseudocode is executed using the "Library" dataset. What will count represent at the end of the execution?
  8. Q9The following pseudocode is executed using the "Words" dataset. What will count. represent at the end of the execution?
  9. Q10The following pseudocode is executed using the "Words" dataset. At the end of the execution, A captures the number of s…
  10. Q11The following pseudocode is executed using the "Library" dataset. At the end of the execution, A captures the number of…
  11. Q12The following pseudocode is executed using the "Scores" dataset. At the end of the execution, C captures the number of …
  12. Q13The following pseudocode is executed using the "Library" dataset. Assume that every author has published at least two b…
  13. Q14The following pseudocode is executed using the "Library" dataset. Assume that every author has published at least two b…