Plan 6
Plan 6
*8472529931*
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
[Turn over
1 Consider the logic expression:
(a) Draw a logic circuit for this logic expression. Each logic gate must have a maximum of two
inputs. Do not simplify this logic expression.
B X
[4]
(b) Complete the truth table from the given logic expression.
Working space
A B C X
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
[4]
2 This flowchart represents an algorithm to find the average size of groups of visitors to an attraction.
START
NumberGroups 0
Total 0
INPUT
GroupSize
IS Yes
GroupSize Average DIV(Total, NumberGroups)
= 0?
No OUTPUT
"Average group
NumberGroups NumberGroups + 1 size ", Average
7, 10, 2, 8, 3, 9, 0, 6
[4]
3 A storage unit rental company wants to set up a new database table for the storage units that can
be rented.
(a) (i) Give the name of the field that would be used for the primary key.
......................................................................................................................................... [1]
(ii) State the reason for choosing this field for the primary key.
...........................................................................................................................................
......................................................................................................................................... [1]
(b) Complete the table to identify the most appropriate data type for these fields in the table
StorageUnits
(c) Complete this structured query language (SQL) statement to display only the storage code,
price and size in square metres of all the storage units where there is a hoist available.
SELECT ....................................................................................................................................
FROM ........................................................................................................................................
WHERE .............................................................. ;
[4]
4 The flowchart represents an algorithm.
START
INPUT
Numbers[Count]
STOP
Count Count + 1
No IS Count >
Limit?
IS Numbers[Count] > No
Yes
Numbers[Count + 1]?
Flag TRUE
Yes
Swap Numbers[Count]
IS Flag = No
TRUE?
Numbers[Count] Numbers[Count + 1]
Yes
Flag True
Count Count + 1
6
(a) Complete the trace table for the input data:
Numbers
Limit Count [1] [2] [3] [4] [5] [6] [7] Flag Swap Result OUTPUT
[7]
5 Consider the logic expression:
S Z
[5]
(b) Complete the truth table from the given logic expression.
Working space
R S T Z
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
[4
9
6 A database table called SoftDrinks stores details of the soft drinks sold by a small shop.
Name Cola
Container Can
SizeCl 330
NumberInStock 30
ReorderLevel 15
Reordered Yes
a. State whether any of the given fields would be suitable as a primary key and give a
reason for your answer.
...................................................................................................................................................
. ................................................................................................................................................ [1]
b. Complete the structured query language (SQL) statement to return the number of
cans the shop has in stock.
FROM .......................................................
10