Quiz Space

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

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

Question 1

+1.5 marksOne correct option

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

text
A = 0, B = 0
while (Table 1 has more rows) {
Read the top row X from Table 1
if (X.Gender == 'M') {
A = A + 1
}
else {
if (X.Gender == 'F' or X.CityTown == "Chennai") {
B = B + 1
}
}
Move X to Table 2
}

What will B represent at the end of execution of pseudocode?

  1. A

    Number of female students

  2. B

    Number of female students + Number of students from Chennai

  3. C

    Number of female students + Number of male students from Chennai

  4. D

    Number of students from Chennai + Number of female students who are not from Chennai

  5. E

    None of these

Show answer

Correct answer

  • A

    Number of female students

Question 1 of 25 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) End Term paper sat on 22 Aug 2021, in the May 2021 term (IITM TERM FINAL EXAM POD21TEFNQPA 22 Aug 2021). It carries 1.5 marks.

More questions from this paper

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