Quiz Space

Computational Thinking End Term: 3 April 2022 (January 2022 term)

Question 1

+4 marksOne correct option

Let X and Y be two rows in the “Library” table. We call X and Y compatible if books in rows X and Y are either published in the same year or under the same genre but not both. Let Compatible(X, Y) be a procedure to find whether X and Y are compatible. Choose the correct implementation of the procedure Compatible.

  1. A
  2. B
  3. C
  4. D

Question 2

+3 marksOne correct option

The following pseudocode is executed using the “Scores” dataset. Two students form a study pair if the difference of their Mathematics marks is at most 10.

text
count1 = studyPair(Table 1)
while (Table 1 has more rows) {
Read the first row X in Table 1
if (X.CityTown == "Chennai") {
Move X to Table CHN
}
if (X.CityTown == "Bengaluru") {
Move X to Table BLR
}
if (X.CityTown == "Vellore") {
Move X to Table VLR
}
}
count2 = studyPair(Table CHN) + studyPair(Table BLR) + studyPair(Table VLR)
Procedure studyPair(Table 1)
Table T1 = Table 1
A = 0
while (Table T1 has more rows) {
Read the first row X in Table T1
Move X to Table T2
while (Table T1 has more rows) {
Read the first row Y in Table T1
Move Y to Table T3
if (-10 ≤ X.Mathematics - Y.Mathematics ≤ 10) {
A = A + 1
}
}
Move all rows from Table T3 to Table T1
}
return(A)
End studyPair

Based on the above data, answer the given subquestions.

What will count1 represent at the end of execution?

  1. A

    Number of study pairs

  2. B

    Number of pairs of study pairs

  3. C

    Number of students who formed study pairs

  4. D

    Number of study pairs from a same city

Question 3

+3 marksOne correct option

The following pseudocode is executed using the “Scores” dataset. Two students form a study pair if the difference of their Mathematics marks is at most 10.

text
count1 = studyPair(Table 1)
while (Table 1 has more rows) {
Read the first row X in Table 1
if (X.CityTown == "Chennai") {
Move X to Table CHN
}
if (X.CityTown == "Bengaluru") {
Move X to Table BLR
}
if (X.CityTown == "Vellore") {
Move X to Table VLR
}
}
count2 = studyPair(Table CHN) + studyPair(Table BLR) + studyPair(Table VLR)
Procedure studyPair(Table 1)
Table T1 = Table 1
A = 0
while (Table T1 has more rows) {
Read the first row X in Table T1
Move X to Table T2
while (Table T1 has more rows) {
Read the first row Y in Table T1
Move Y to Table T3
if (-10 ≤ X.Mathematics - Y.Mathematics ≤ 10) {
A = A + 1
}
}
Move all rows from Table T3 to Table T1
}
return(A)
End studyPair

Based on the above data, answer the given subquestions.

What will count2 represent at the end of execution?

  1. A

    Number of study pairs where students in each pair are from the same city

  2. B

    Number of study pairs where students in each pair are from different cities among Chennai, Bengaluru and Vellore

  3. C

    Number of study pairs where students in each pair are from the same city among Chennai, Bengaluru and Vellore

  4. D

    Number of study pairs where students in each pair are from Chennai

24 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the Computational Thinking (CT) End Term 3 Apr 2022 paper

The IIT Madras BS Computational Thinking (Computational Thinking (CT)) End Term paper sat on 3 Apr 2022, in the January 2022 term: 27 questions for 100 marks in 180 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureComputational Thinking (CT) End Term 3 Apr 2022 at a glance
TermJanuary 2022 term
SubjectComputational Thinking
Course codeBSCS1001
Questions27
Marks100
Duration180 min
MCQ23
MSQ3
Numerical1
Official paperIIT M FOUNDATION DIPLOMA ENDTERM FN1 3 Apr 2022
Negative markingNo negative marking.
Updated

Same End Term, other subjects

More Computational Thinking (CT)