CS Year 10 Practical June 2022
CS Year 10 Practical June 2022
SENIOR SECTION
Year 10
Name : …………………………………………………………………………………
Class : ………………………………………….………………………………………
2. The marks for each question are shown in brackets – use this as a guide as to how much time to spend on
each question.
0
1 Computer programs make use of many programming constructs.
A modulus
B OR
C >=
D =
(b) Describe one difference between a one-dimensional array and a two-dimensional array.
(2)
....................................................................................................................................................................................................................................................................................
....................................................................................................................................................................................................................................................................................
....................................................................................................................................................................................................................................................................................
....................................................................................................................................................................................................................................................................................
The program should calculate how many £20 are in £113 and how much is
left over.
1
(i) at the end of the line where there is a relational operator
(2)
2
3
Write a program to implement the logic in the flowchart. (11)
You must use the structure given in Q02a to write the program.
Number of books sold is at least 5 and Sales and profit are good this week
profit made is at least 10
Number of books sold is over 20 and profit Sales and profit are excellent this week
made is at least 20
Number of books sold is under 5 or profit Poor performance this week
made is under 5
Save your code as Q02bFINISHED with the correct file extension for the programming language.
(9)
4
3 Bill sells snacks at an after-school club.
(a) He wants a program that will hold details of the products he sells.
The program must:
You must use the structure given in the file Q03a to complete the program.
(10)
(b) Bill plans to implement a binary search algorithm to search a table of products.
....................................................................................................................................................................................................................................................................................
....................................................................................................................................................................................................................................................................................
....................................................................................................................................................................................................................................................................................
5
6
(iii) Bill has another list containing the names of five students who attend the after-school club.
Give the maximum number of names that would need to be examined by the binary
search algorithm to determine whether a name appears in the list.
(2)
....................................................................................................................................................................................................................................................................................
………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………
(iv) Give the name of another algorithm that could be used to sort a list.
(2)
.........................................................................................................................................................................................................................................................................................................................................................
7
4 Estelle is learning about sorting and searching algorithms.
(a) Estelle’s friend has given her a partially completed program to carry out a binary search.
You must use the structure given in Q04a to write the program.
Save your code as Q04aFINISHED with the correct file extension for the
programming language.
(10)
8
(b) Figure 3 shows an array of names.
0 1 2 3 4 5 6 7
Explain why a binary search algorithm would not find 'Julian' in the array.
(5)
....................................................................................................................................................................................................................................................................................
....................................................................................................................................................................................................................................................................................
....................................................................................................................................................................................................................................................................................
....................................................................................................................................................................................................................................................................................
9
(c) A merge sort algorithm can be used to sort a list ascending order. (5)
END OF PAPER
10