Quiz Space

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

Question 12: The following pseudocode is executed using a dataset sim…

Question 12

+5 marksNumerical answer

The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph.

"Moments later, Susan takes a leisurely stroll, immersing herself in the peaceful surroundings. Mornings, with their calm and solitude, motivate Susan to embrace the day with a positive outlook. The motion in the trees catches her attention, signifying the awakening of nature."

text
count = 0, flag = True
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
if(flag){
if(1st letter of X.Word == 'm'){
if(2nd letter of X.Word == 'o'){
count = count + 1
}
}
}
flag = False
if(X.Word ends with full stop){
flag = True
}
}

What would be the value of the count at the end of the execution of the above pseudocode? Assume that upper case and lower case are ignored during comparison of letters.

Show answer

Correct answer: 2

Question 12 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 5 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. Q2The following pseudocode is executed using the "Scores" dataset. At the end of the execution of below pseudocode, if co…
  3. Q3The following pseudocode is executed using the "Words" dataset. At the end of the execution, count stores the number of…
  4. Q4The following pseudocode is executed using the "Scores" dataset. Assume that the variable AvgT holds the value of the a…
  5. Q5Procedure miniSum accepts three numbers as parameters and returns the sum of two smallest numbers.\ Choose the correct …
  6. Q6The following pseudocode is executed using the "Scores" dataset. What will count represent at the end of the execution?
  7. Q7The following pseudocode is executed using the “Scores” dataset. What will A represent at the end of the execution?
  8. Q8The following pseudocode is executed using the “Olympics” dataset. Procedure doSomething accepts a table of rows that c…
  9. Q9The given pseudocode is executed using the “Olympics” table. At the end of execution, count represent the number of pai…
  10. Q10The following pseudocode is executed using the "Scores" dataset. At the end of the execution of the below pseudocode, i…
  11. Q11The given information represents a "Library" dataset and it may have some mistakes with respect to the sanity of the da…