**UNIVERSITY EXAMINATIONS: 2019/2020**

**EXAMINATION FOR THE DEGREE OF BACHELOR OF SCIENCE IN **

**SOFTWARE DEVELOPMENT/ INFORMATION SECURITY & FORENSCIS**

**BSD 1208: COMPUTATIONAL THINKING THEORY**

**FULL TIME/ PART TIME**

**DATE: MAY, 2020 TIME: 6 HOURS**

**INSTRUCTIONS: Answer ALL Questions**

**SECTION TWO: (20 MARKS)**

(a) Briefly explain the following terms in the context of computational thinking theory. Write a

sample python code to demonstrate implementation of each term

i) Variable (3 Marks)

ii) Data Dictionary (3 Marks)

(b) Briefly the meaning of the term “pattern Recognition” as used in computational thinking theory

Give an example to illustrate your answer (2 Marks)

(c) Consider a program that uses problem decomposition, control abstraction and re-using practices to

solve the following problem:

Main Problem: Compute course work results (assignments + cats)

Sub problems:

1. Compute assignments total (assign1 +assign2)

2. Compute Cats total (Cat1+Cat2)

3. Compute sum of cats and assigns (Cats + assigns)

i) Write a pseudocode for the above program. (3 Marks)

ii) Draw a flowchart to represent to graphically represent the pseudocode written in (i)

(3 Marks)

iii) Write a sample python code that demonstrates how the pseudocode written in (i) can be

implemented (6 Marks)

**SECTION THREE: (20 MARKS)**

(a) A tourist is on holiday in UK; currently he is in London. He want to take flight Tomorrow to

Liverpool though he don’t know the path to liver pool. Use the following map to define any five

elements of his search problem

(5 Marks)

(b) A group of inspectors need to make an inspection of the river today: at least one of them has to swim

along each of the river streams. Due to the heavy current, inspectors can only sail a boat downstream

and they can only do one trip from A to B. So the inspectors start at A, and they will meet at B. Every

stream of the river has to be inspected. The figure below show a map of the river streams.

(i)Use the above figure to determine number of inspectors needed for a full inspection (2 Marks)

(ii) Describe computation thinking concept that has been used to solve the problem of inspecting the

river in(i). (3 Marks)

A

B

(c) write a program the uses problem decomposition, control abstraction and re-using practices to solve

the following problem: (6 Marks)

Main Problem: Compute course work results (assignments + cats)

Sub problems:

1. Compute assignments total (assign1 +assign2)

2. Compute Cats total (Cat1+Cat2)

3. Compute sum of cats and assigns (Cats + assigns)

(d) Alice and Bob want to send signals in the night using a flashlight. They transmit sequences of 4

symbols ‘0’ or ‘1’. Before each sequence they turn on the light for 1 second. If the symbol is ‘0’, the light

is on for 1 second and if the symbol is ‘1’, the light is off for 1 second. After each sequence a pause of at

least 1 second is made. For example, the sequences ‘1001’ and ‘0110’ are transmitted as follows:

i) Which sequence or sequences of signals are transmitted in the following diagram?

(2 Marks)

ii) Draw a diagram to illustrate how the sequences ‘10010101’ and 1100101 can be transmitted

(2 Marks)