Quiz Space

Computational Thinking Quiz 1: 11 July 2021, Set POD21QZAQPA (May 2021 term)

Question 1

+3 marksOne correct option

Let L be a non-empty list of integers, and D be a non-empty dictionary which are given below:

L = [-2, -1, 0, 1, 2]
D = {-2: 'a', 2: 'b', -1: 'c', 1: 'd', 0: 'e'}

Match the following expressions on the left side with the appropriate values on the right side.

a. D['a']
b. keys(D)
c. isKey(D, 1)
d. first(init(L)) + last(rest(L))
e. first(rest(L)) + last(init(L))
f. last(init(init(L)))

  1. True
  2. Invalid key
  3. L
  4. 0
  5. -1
  6. A list
  1. A

    a - (2), b - (3), c - (2), d - (4), e - (5), f - (5)

  2. B

    a - (2), b - (6), c - (1), d - (4), e - (4), f - (4)

  3. C

    a - (2), b - (3), c - (2), d - (4), e - (4), f - (4)

  4. D

    a - (4), b - (6), c - (1), d - (4), e - (5), f - (5)

  5. E

    None of these

Question 2

+3 marksOne correct option

The following pseudocode is executed using the "Scores" dataset. Let sum be a procedure which takes a list as input and returns the sum of the elements of the list. What will A represent at the end of the execution?

text
cityD = { }
while (Table 1 has more rows) {
Read the first row X in Table 1
if (isKey(cityD, X.CityTown)) {
if (isKey(cityD[X.CityTown], X.Gender)) {
cityD[X.CityTown][X.Gender] = cityD[X.CityTown][X.Gender] ++ [X.Physics]
}
else {
cityD[X.CityTown][X.Gender] = [X.Physics]
}
}
else {
cityD[X.CityTown][X.Gender] = [X.Physics]
}
Move row X to Table 2
}
A = 0
foreach i in keys(cityD) {
P = findSomething(cityD[i]['M'], cityD[i]['F'])
if (P) {
A = A + 1
}
}
Procedure findSomething(l1, l2)
p = sum(l1)/length(l1)
q = sum(l2)/length(l2)
if (q > p) {
return (True)
}
else {
return (False)
}
End findSomething
  1. A

    Number of cities in which Physics marks of boys are more than girls

  2. B

    Number of cities in which Physics marks of girls are more than boys

  3. C

    Number of cities in which average Physics marks of boys are more than girls

  4. D

    Number of cities in which average Physics marks of girls are more than boys

  5. E

    None of these

Question 3

+1 markOne correct option

Choose the correct option based on the following pseudocode in the given subquestions.

text
L = [0]
LA = [[1], [1, 2], [1, 2, 3]]
LB = [ ], LC = [ ]
foreach A in LA {
foreach B in A {
LB = [B] ++ LB
L = [first(L) + B]
}
LC = [LB] ++ LC
LB = [ ]
}

What will be the value of L at the end of execution?

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

9 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) Quiz 1 11 Jul 2021 Set POD21QZAQPA paper

The IIT Madras BS Computational Thinking (Computational Thinking (CT)) Quiz 1 paper sat on 11 Jul 2021, in the May 2021 term, set POD21QZAQPA: 12 questions for 25 marks in 120 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) Quiz 1 11 Jul 2021 Set POD21QZAQPA at a glance
TermMay 2021 term
SubjectComputational Thinking
Course codeBSCS1001
Questions12
Marks25
Duration120 min
MCQ11
MSQ1
Official paperIIT M QUIZ EXAM POD21QZAQPA FN 11 July 2021
Negative markingNo negative marking.
Updated

Other sets that day

Same Quiz 1, other subjects

More Computational Thinking (CT)