Quiz Space

Computational Thinking (CT) week 3 important questions

Week 3 of Computational Thinking: Multiple iterations, procedures, parameters, side effects. Extra important questions based on the recent, changing patterns of the exams, from basic to advanced. Practise them in learning mode: each question has a worked solution.

Question 1

Numerical answer

Table 1 holds the "Scores" dataset.

NameCityMathsPhysics
NikhilJaipur9691
DevKochi9548
FaridChennai8132
AshaKochi3965
OmkarKochi3091
MeenaPune9890
KavyaKochi9886

The following pseudocode is executed.

max = 0
while (Table 1 has more rows) {
Read the first row X in Table 1
if (X.Maths > max) { max = X.Maths }
Move X to Table 2
}
count = 0
while (Table 2 has more rows) {
Read the first row Y in Table 2
if (Y.Maths == max) { count = count + 1 }
Move Y to Table 3
}
Print count

What is printed?

Question 2

One correct option

Table 1 holds the "Scores" dataset.

NameCityMathsPhysics
PriyaChennai8981
GitaDelhi3434
IshaChennai4075
BhavinChennai4030
OmkarPune6961
JayPune6841

The following pseudocode is executed.

total = 0
while (Table 1 has more rows) {
Read the first row X in Table 1
total = total + X.Physics
Move X to Table 2
}
count = 0
while (Table 2 has more rows) {
Read the first row Y in Table 2
if (Y.Physics * 4 > total) { count = count + 1 }
Move Y to Table 3
}
Print count

What is printed?

  1. A

    00

  2. B

    22

  3. C

    −1-1

  4. D

    11

Question 3

Numerical answer

Table 1 holds the "Scores" dataset.

NameCityMathsPhysics
NikhilChennai7453
EshaKochi9895
HariDelhi4131
MeenaPune8695
AshaChennai4290
GitaJaipur9441

The following pseudocode is executed.

best = 0
while (Table 1 has more rows) {
Read the first row X in Table 1
if (X.Maths + X.Physics > best) { best = X.Maths + X.Physics }
Move X to Table 2
}
count = 0
while (Table 2 has more rows) {
Read the first row Y in Table 2
if (Y.Maths + Y.Physics >= best - 10) { count = count + 1 }
Move Y to Table 3
}
Print count

What is printed?

More questions in this week

Authorise with Google to see every question with its answer and explanation and practise it in learning mode.