QuizSpace

Computational Thinking (CT) week 5 important questions

Week 5 of Computational Thinking: Lists, insertion sort. 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

In the pseudocode, a list is written in square brackets. L[0] is the first element, L[1] the second, and so on. length(L) gives the number of elements and append(L, x) adds x at the end.

L = [9, 22, 17, 12, 4, 10, 2] Print L[1] + L[2]

What is printed?

Question 2

One correct option

In the pseudocode, a list is written in square brackets. L[0] is the first element, L[1] the second, and so on. length(L) gives the number of elements and append(L, x) adds x at the end.

L = [28, 39, 24]
append(L, 17)
append(L, 4)
Print L[length(L) - 1] - L[0]

What is printed?

  1. A

    −25-25

  2. B

    −23-23

  3. C

    −48-48

  4. D

    −24-24

Question 3

Numerical answer

In the pseudocode, a list is written in square brackets. L[0] is the first element, L[1] the second, and so on. length(L) gives the number of elements and append(L, x) adds x at the end.

L = [17, 6, 20, 21, 15]
total = 0
i = 0
while (i < length(L)) {
total = total + L[i]
i = i + 2
}
Print total

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.

IMPPractise OPPE 1 PYQs:PythonSystem CommandsJava