Quiz Space

Computational Thinking · End Term · 8 Aug 2021 · May 2021 term

Question 24: The following pseudocode is executed using the "Words" d…

Question 24

+2 marksOne correct option

The following pseudocode is executed using the "Words" dataset.

text
D = { }
while (Table 1 has more rows) {
Read the first row X in Table 1
D[X.Seq_No] = X.Word
Move row X to Table 2
}
i = 0
a = 0, b = 0, c = 0, d = 0
aList = [ ], bList = [ ], cList = [ ], dList = [ ]
while (i < length(keys(D)) - 1) {
if (first letter of word D[i] is a vowel) {
if (first letter of word D[i +1] is a vowel) {
a = a + 1
aList = aList ++ [D[i]]
}
else {
b = b + 1
bList = bList ++ [D[i]]
}
}
else {
if (first letter of word D[i +1] is a vowel) {
c = c + 1
cList = cList ++ [D[i]]
}
else {
d = d + 1
dList = dList ++ [D[i]]
}
}
i = i + 1
}

Study the pseudocode given above and answer the subquestions:

What will the elements of list aList represent at the end of execution?

  1. A

    Words which begin with a vowel and followed by a word which begins with a vowel

  2. B

    Words which begin with a vowel and followed by a word which ends with a vowel

  3. C

    Words which end with a vowel and followed by a word which begins with a vowel

  4. D

    Words which end with a vowel and followed by a word which ends with a vowel

  5. E

    None of these

Show answer

Correct answer

  • A

    Words which begin with a vowel and followed by a word which begins with a vowel

Question 24 of 25 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) End Term paper sat on 8 Aug 2021, in the May 2021 term (IIT M TERM FINAL EXAM POD21TEFNQP1 8 Aug 2021). It carries 2 marks.

More questions from this paper

  1. Q1The following pseudocode is executed using the "Scores" dataset. What will B represent at the end of execution of pseud…
  2. Q2The following pseudocode is executed using the "Words" dataset. What does count represent at the end of execution?
  3. Q3The following pseudocode is executed using the "Library" dataset. What does (count−A+B) represent at the end of executi…
  4. Q4The following pseudocode is executed using the "Scores" dataset. What will (B + D) − (A + C) represent at the end of ex…
  5. Q5The following pseudocode is executed using the "Library" dataset. What does the count represent at the end of execution?
  6. Q6The following pseudocode is executed using the "Scores" dataset. What does List store at the end of execution?
  7. Q7Consider the following pseudocode. How many times will the procedure fib( ) be called if n = 5, excluding the main call?
  8. Q8Consider a matrix M generated from the "Words" dataset. If i and j represent two different words, when will M[i][j] be …
  9. Q9The following pseudocode is executed using the "Olympics" dataset. When will count2 be greater than count1?
  10. Q10The following pseudocode is executed using the "Library" dataset. What will L represent at the end of execution?
  11. Q11The following pseudocode is executed using the "Scores" dataset. What will B represent at the end of the execution?
  12. Q12The following table contains information regarding the books in "Library" dataset. Each entry in the table corresponds …
  13. Q13Figure question
  14. Q14Consider the definition of the object datatype ClassList. Let cL be a ClassList object. Choose the correct statement(s)…
  15. Q15The following pseudocode is executed using the "Words" dataset? Based on the above data, answer the given subquestions.…
  16. Q16The following pseudocode is executed using the "Words" dataset? Based on the above data, answer the given subquestions.…
  17. Q17The following pseudocode is executed using the "Words" dataset? Based on the above data, answer the given subquestions.…
  18. Q18The following pseudocode constructs a graph from the “Words” dataset. A dictionary wordI is created. Each word in the d…
  19. Q19The following pseudocode constructs a graph from the “Words” dataset. A dictionary wordI is created. Each word in the d…
  20. Q20The following pseudocode constructs a graph from the “Words” dataset. A dictionary wordI is created. Each word in the d…
  21. Q21doSomething is a procedure that accepts a non-empty list of integers L as input. The following pseudocode finds the big…
  22. Q22The following pseudocode is executed using the "Words" dataset. count represents the number of letters whose frequency …
  23. Q23Consider the following public procedures function1 and function2 that are defined inside a class Function (not shown he…
  24. Q25The following pseudocode is executed using the "Words" dataset. Study the pseudocode given above and answer the subques…