Beruflich Dokumente
Kultur Dokumente
07 March 2019
Marking Scheme
This marking scheme has been prepared as a guide only to markers. This is not a set of model answers, or
the exclusive answers to the questions, and there will frequently be alternative responses which will provide
a valid answer. Markers are advised that, unless a question specifies that an answer be provided in a
particular form, then an answer that is correct (factually or in practical terms) must be given the available
marks.
If there is doubt as to the correctness of an answer, the relevant NCC Education materials should be the first
authority.
Where markers award half marks in any part of a question, they should ensure that the total
mark recorded for the question is rounded up to a whole mark.
Marks
Question 1
a) Describe the FOUR (4) key steps in writing a simple computer program. 4
b) A school teacher wishes to calculate what percentage of the students in her class 2
have coloured eyes as opposed to brown eyes. She will write a simple computer
program to do the calculation.
What data type is suitable to hold the input data (number of coloured or brown
eyes)?
What data type is suitable to hold the output data (percentage)?
The input data will be a whole number of coloured eyes (1 mark). The
percentage data will be a real number as it can be expressed as a fraction
(1 mark).
c) Assembly languages are NOT portable languages whereas high level languages 4
are portable languages. Explain what is meant by this statement.
Total 10 Marks
Page 2 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 2
Pseudocode has many definitions, but any definition must emphasise any
combination of at least two of the following: it is not a real computer
language (1 mark), it is expressed in a semi-formal manner (1 mark), it is
used to develop algorithms before they are coded in a formal computer
language (1 mark), it lends itself to desk-checking on paper (1 mark).
(maximum 2 marks)
(Allow other similar statements)
Total 10 Marks
Page 3 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 3
ANSWER
line number result notes
1 0 Declaration of variable
2 0 0 Declaration of variable
3 3 0 User input = 3
4 3 3
5 3 3
6 2 3 Decrement number by 1
7 2 6 result = 2 * 3 = 6
8 2 6
5 2 6 Repeat the loop as number is
not 1
6 1 6 Decrement number by 1
7 1 6 result = 1 * 6 = 6
8 1 6
5 1 6 Exit the loop as number = 1
9 1 6 Output 6
0.5 mark for each correct entry in the table (maximum 7 marks)
Deduct 1 mark for no notes at all or for notes that are mostly wrong or
inappropriate.
Total 10 Marks
Page 4 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 4
For example:
data index1 as whole number (1 mark)
data index2 as whole number (1 mark)
data multi as array (10, 10) of whole numbers (1 mark)
index1=0
loop until index1 is equal to 10 (1 mark)
index2 = 0
loop until index2 is equal to 10 (1 mark)
multi[index1, index2] = 0 (1 mark)
index2 = index2 + 1 (1 mark)
next loop (1 mark)
index1 = index1 + 1 (1 mark)
next loop (1 mark)
Students do not need to explicitly set the loop counter to zero.
Total 10 Marks
Page 5 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 5
a) A stack data structure is often abbreviated as LIFO type data structure. Explain 2
what is meant by LIFO type.
LIFO stands for Last-In-First-Out (1 mark). In stack structure the data that is
at the top of the stack is the one that is the first one taken out of the stack
(1 mark).
b) A stack contains the numbers 2, -5, 10, and -3 where the number 2 is at the top 8
of the stack and the number -3 at the bottom. A program gets two numbers from
top of the stack by two pop operations. It then adds them up and puts the
resulting number on top of the stack by a push operation. It repeats this process
until only one number is left on the stack. Fill in the table below to show this
process and copy it into your answer book. The table is partially filled in for you.
ANSWER
Operations Values Contents of stack after operations
(Leftmost number is at the top of the
stack)
pop, pop 2, -5 10, -3
add -3 10, -3
push -3 -3, 10, -3
pop, pop -3, 10 -3
add 7 -3
push 7 7, -3
pop, pop 7, -3
add 4
push 4 4
Total 10 Marks
Page 6 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 6
a) Identify and fill in the missing logic operators that obey the given rules in the table 2
below and copy it into your answer book
Rule Logic
operation
Both parts must be
true
Either part can be true
ANSWER
Rule Logic
operation
Both parts must be AND
true
Either part can be true OR
b) Fill in the truth table below for the compound conditional a AND (b OR c) where 8
a, b and c can have TRUE or FALSE values and copy it into your answer book
a b c (b OR c) a AND (b OR c)
FALSE FALSE FALSE
FALSE FALSE TRUE
FALSE TRUE FALSE
FALSE TRUE TRUE
TRUE FALSE FALSE
TRUE FALSE TRUE
TRUE TRUE FALSE
TRUE TRUE TRUE
ANSWER
a b c (b OR c) a AND (b OR c)
FALSE FALSE FALSE FALSE FALSE
FALSE FALSE TRUE TRUE FALSE
FALSE TRUE FALSE TRUE FALSE
FALSE TRUE TRUE TRUE FALSE
TRUE FALSE FALSE FALSE FALSE
TRUE FALSE TRUE TRUE TRUE
TRUE TRUE FALSE TRUE TRUE
TRUE TRUE TRUE TRUE TRUE
Total 10 Marks
Page 7 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 7
b) Design a function in pseudocode that takes TWO (2) whole numbers, firstNum 4
and secondNum, as parameters, adds the numbers up and returns the result as
a whole number.
c) Write a line of pseudocode that uses the function in (b) above to add the 2
numbers 3 and -6 and stores the result in a variable. You need to declare the
variable.
Total 10 Marks
Page 8 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 8
An array of whole numbers contains the numbers 2, 5, 10, 16, 28 in sorted order.
a) How many linear search operations will be needed on the array before locating 2
the number 28? Explain how you calculated this.
Starting from the first entry in the array and searching successive entries (1
mark), 5 array locations will be searched until 28 is located (1 mark)
b) How many binary search operations will be needed on the array before locating 3
the number 28? Explain how you calculated this.
c) What is the 'Big O' notation for the linear search? Explain what this notation 2
means.
d) Name TWO (2) popular sorting algorithms. State which is more efficient. 3
Total 10 Marks
Page 9 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 9
a) A program accepts TWO (2) whole numbers between 10 and -10 as inputs. 3
Suggest i) a test case for boundary testing, ii) a test case for testing maximums
and minimums and iii) a test case for invalid input.
i) 1, 0 or 0, -1 (1 mark)
ii) 11, -11 (1 mark)
iii) Use of any real number or string, i.e. other than whole number type
(1 mark)
c) What are the TWO (2) testing techniques that can be used to compare test data 3
against the expected results? Which technique does desk-checking use?
Total 10 Marks
Page 10 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 10
a) Write a class in pseudocode that has the name Restaurant and has just the 3
attributes name, distance (has a decimal point), rating (e.g. 1 to 5 stars) and
telephone using suitable data types.
Class Restaurant
data name as string
distance as real
rating as whole number
telephone as string
End class
End of paper
Page 11 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Learning Outcomes matrix
Grade descriptors
Page 12 of 12
Software Development Techniques © NCC Education Limited 2019