CS Test 2
CS Test 2
Name
Time : 1 hour
Answer all questions.
For example, using the process in Figure, Tom Ward’s username would be TomWa.
(a) State, using the process in Figure, the username for Rebecca Ellis and Catherine
Earnshaw. [2]
…………………………………………………………………………………
…………………………………………………………………………………
…………………………………………………………………………………
(ii) Write a program code for the updated program design shown in question 4(b)(i). [6]
You must use either a high-level programming language that you have studied or
pseudocode.
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
5. Match the following terms with related statements explanatory notes. (Write only alphabet)
[10]
(a) Linear search (b) subprogram (c) Merge sort (d) divide and conquer (e) initialise
(f) execution (g) abstraction (h) brute force (i) computational thinking (j) character
(i) An algorithm design that does not include any techniques to improve performance, but
instead relies on computing power to try all possibilities until the solution to a problem is
found. h
(ii) A sorting algorithm that divides a list into two smaller lists and then divides these until
the size of each list is one. Repeatedly applying a method to the results of a previous
application of the method. c
(iii) It is a simple algorithm and not very sophisticated. It simply starts at the beginning of the
list and goes through it, item by item, until it finds the item it is looking for or reaches the end
of the list without finding it. a
(iv) The process of removing or hiding unnecessary detail so that only the important points
remain. g
(v) An algorithm design that works by dividing a problem into smaller and smaller sub-
problems, until they are easy to solve. The solutions to these are then combined to give a
solution to the complete problem. d
(vi) The thought processes involved in formulating problems and their solutions so that the
solutions are represented in a form that can be effectively carried out by a computer. i
(vii) The processing can be split into parts. These separate algorithms could be used when
they are needed. It is efficient because it means that the same code doesn’t have to be
rewritten whenever it is needed. b
(viii) The process by which a computer carries out the instructions of a computer program.
f
(ix) A character can be a single letter, a symbol, a number or even a space. It is one of the
four basic data types. j
(x) When the program is run, to set variables to their starting values at the beginning of a
program or subprogram. e
2(a)
SEND TO DISPLAY
SEND TO DISPLAY
IF num2 [1]
print(num1)
else:
print(num2)
3(a) [4]
(b)[4]
e.g.
compare to zebra
(c) [2]
Integer (1)…
Real (1)…
One mark for appropriate justification linked to the data type chosen.