Quiz Space

Computational Thinking · Qualifier · 7 Aug 2022 · May 2022 term

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

Question 10

+4 marksOne correct option

The following pseudocode is executed using the "Words" dataset. What will A represent at the end of execution?

text
A = 0, B = 0, C = 0
while (Table 1 has more rows) {
Read the first row X in Table 1
Move X to Table 2
if (X.PartOfSpeech == “Adjective”) {
B = B + 1
}
if (X.PartOfSpeech == “Verb”) {
C = C + 1
}
if (X.Word ends with a full stop) {
if (B ≥ 1 and C ≤ 2) {
A = A + 1
}
B = 0, C = 0
}
}
  1. A

    Number of sentences with at most two adjectives and one verb

  2. B

    Number of sentences with two adjectives and at least one verb

  3. C

    Number of sentences with at least one verb and at most two adjectives

  4. D

    Number of sentences with at least one adjective and at most two verbs

Show answer

Correct answer

  • D

    Number of sentences with at least one adjective and at most two verbs

Question 10 of 14 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) Qualifier paper sat on 7 Aug 2022, in the May 2022 term (IIT M QUALIFIER EXAM QPE 07 Aug 2022 IBA NS). It carries 4 marks.

More questions from this paper

  1. Q1The following pseudocode is executed using the "Words" dataset. What will A represent at the end of execution?
  2. Q2The following pseudocode is executed using the "Olympics" dataset. Assume that no player won more than one medal. What …
  3. Q3The following pseudocode is executed using the "Scores" dataset. What will Count represent at the end of execution? It …
  4. Q4The following pseudocode is executed using the "Olympics" dataset. Count represents the number of pairs of distinct pla…
  5. Q5The following pseudocode is executed using the "Words" dataset. Based on the above data, answer the given subquestions.…
  6. Q6The following pseudocode is executed using the "Words" dataset. Based on the above data, answer the given subquestions.…
  7. Q7A palindrome is a sequence of characters which reads the same backward as forward, for example level and noon. The foll…
  8. Q8The following pseudocode is executed using the "Scores" dataset. What will Count represent at the end of execution?
  9. Q9The following pseudocode is executed using the "Scores" dataset. At the end of execution, B captures the minimum Mathem…
  10. Q11The following pseudocode is executed using the "Scores" dataset. What will A represent at the end of execution?
  11. Q12The following pseudocode is executed using the "Scores" dataset. What will (A - B) represent at the end of execution?
  12. Q13A sentence is said to be balanced if there are equal numbers of vowels and consonants in it. The following pseudocode i…
  13. Q14The following pseudocode is executed using the "Olympics" dataset. It counts the number of pairs of players who have th…