Sie sind auf Seite 1von 12

Software Development Techniques

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.

Throughout the marking, please credit any valid alternative point.

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.

Software Development Techniques Page 1 of 14 © NCC Education Limited 2019


Answer ALL questions

Marks
Question 1

a) Describe the FOUR (4) key steps in writing a simple computer program. 4

1 mark each for the following (maximum 4 marks):


(Sensible brief descriptions around each of the following points are
expected)
1. Data representation
2. Input of data
3. Algorithm
4. Output

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.

Every different computer type will have different assembly instructions (1


mark). The same program must be re-written in each computer's unique
assembly language (1 mark). Programs written in high-level languages
need not be re-written for different types of computers (1 mark) as long as
they can be compiled on these computers (1 mark).

Total 10 Marks

Page 2 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 2

a) Software development often starts by the definition of algorithms in pseudocode. 4


what pseudocode is and give TWO (2) reasons why it is useful.

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)

1 mark for each of the following (up to maximum 2 marks)


It is independent of any specific computer language
Can focus on algorithm design rather than some language specific features
It enables formal checking of algorithm correctness on paper

b) Pseudocode of an algorithm is expressed in a high-level computer language. 4


Describe what a high-level computer language is. Give THREE (3) examples of
high-level languages.

High-level computer language is computer instruction represented in a


language that is easy for humans to understand (1 mark). Examples of
high-level languages are: C#, Java, C, C++, Python (1 mark for each
example - maximum 3 marks)

c) A computer program can be written in an assembly language. Explain how 2


assembly language differs from high-level language.

Assembly language is low-level computer instruction representing CPU


instructions in binary number format that requires understanding of a
particular CPU’s instruction set (1 mark) whereas high-level language does
not concern itself with instructions at low-level and does not require any
understanding of specific CPU instruction sets (1 mark).

Total 10 Marks

Page 3 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Question 3

a) Describe what iteration is in programming languages. Explain the difference 3


between the bounded iteration and unbounded iteration.

Iteration is repeated execution of computer instructions in a loop for a


number of times or until a condition is met (1 mark). In bounded iteration
(or loop) the number of iterations is known in advance (1 mark) where as in
unbounded iteration (or loop) the number of iterations depends on a
condition to be satisfied that cannot be determined in advance (1 mark).

b) The following is an iterative pseudocode for calculating the factorial of numbers. 7


Desk-check this pseudocode by constructing a table with four columns headed
line, number, result, notes. Assume the number 3 is input at line 3.

1 data number as whole number


2 data result as whole number
3 input number
4 result = number
5 loop until number is equal 1
6 number = number - 1
7 result = result * number
8 next loop
9 output result

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

a) Write the pseudocode that declares a two-dimensional array of type whole 10


number and fills it with all zeros. Assume the sizes of both dimensions of the
array are 10 each. You will need to declare the variables required by this code.

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.

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

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

0.5 mark for each correct line of operations – maximum 3 marks


0.5 mark for each correct line of values – maximum 3 marks
0.5 mark for each correct entry of contents of stack – maximum 2 marks
Allow for fall-through but deduct 1 mark in this case.

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

1 mark for each correct logical operator (max. 2 marks)

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

0.5 mark for each correct cell entry – maximum 8 marks.

Total 10 Marks

Page 7 of 12
Software Development Techniques © NCC Education Limited 2019
Marks

Question 7

a) Design a function in pseudocode that takes an array, listOfNumbers, of type 4


whole number as a single parameter and outputs the contents of the array.

Function OutNumbers (needs array listOfNumbers of whole numbers)


data counter as whole number
Loop until counter is equal to sizeof(listOfNumbers)
output listOfNumbers[counter]
Next loop
End function

1 mark for function structure


1 mark for parameter specification
1 mark for correct loop structure
1 mark for loop content

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.

Function Add (needs firstNum as whole number, secondNum as whole


number)
returns whole number
return (firstNum + secondNum)
end function

1 mark for function structure


1 mark for parameter specification
1 mark for function return specification
1 mark for correct return statement

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.

Data sum as whole number (1 mark)


sum = Add (3, -6) (1 mark)

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.

First mid-point is located where the array entry is 10. (1 mark)


28 is greater than 10, so find mid-point of right side of 10 which is 16. (1
mark)
28 is greater than 16, so the next number is 28. (1 mark)
There are 3 searches needed.

c) What is the 'Big O' notation for the linear search? Explain what this notation 2
means.

The scale (complexity) of linear search is represented by O(n) (1 mark).


This indicates that linear search scales linearly that is directly proportional
to the number of the items to be searched (1 mark).

d) Name TWO (2) popular sorting algorithms. State which is more efficient. 3

Bubble sort (1 mark)


Quick sort (1 mark)
Accept any other known sorting algorithm.
Quick sort is more efficient (assuming this was given as one of the
examples, otherwise accept any other correct answer) (1 mark)

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)

b) A program depends on correct operation of three functions A, B and C working 4


together. Explain how the programmer might go about conducting unit testing
and integration testing on this program?

The programmer will test each of the functions separately (1 mark) to


ensure that each function correctly independently of each other (1 mark)
The programmer will then test that the functions correctly work together (1
mark) enabling the program functions correctly as a whole (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?

1 mark for each of the following (maximum 3 marks)


Black-box testing
White-box testing
Desk-checking is a type of white-box testing

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

1 mark for correct class structure, i.e. class/end class


0.5 mark for each correct attribute variable and type
b) Write a constructor method in pseudocode for the class Restaurant that initialises 3
the attributes in (a) above.
Function Restaurant (needs n as string, d as real, r as whole number, t as
string)
name = n
distance = d
rating = r
telephone = t
End function
1 mark for correct function structure, i.e. function/end function
0.5 mark for correct initialisation of each of the attributes
c) Write an accessor method in pseudocode to query the rating attribute for the 2
class Restaurant in (a) above.
(Note: the function name is chosen as an example, the student may use
another)
Function queryRating () returns string
return rating
end function
1 mark for correct structure
1 mark for correct return statement
d) Declare and create the object italianRestaurant of class Restaurant that has the 2
name Roma, is at a distance of 20.5 miles, with a rating of 4 and the telephone
number 02155568741.
Data italianRestaurant as Restaurant
italianRestaurant = new Restaurant (“Roma”, 20.5, 4, “02155568741”)
1 mark for correct object declaration
1 mark for correct object creation
Total 10 Marks

End of paper

Page 11 of 12
Software Development Techniques © NCC Education Limited 2019
Marks
Learning Outcomes matrix

Question Learning Outcomes assessed Marker can differentiate between varying


levels of achievement
1 1 Yes
2 1, 2 Yes
3 2, 3 Yes
4 3, 4 Yes
5 4, 5 Yes
6 3, 6 Yes
7 7 Yes
8 4, 5 Yes
9 6 Yes
10 3, 7 Yes

Grade descriptors

Learning Pass Merit Distinction


Outcome
Identify and Provide adequate Provide detailed and Provide comprehensive,
explain the key ability to explain the coherent explanation of lucid explanation of the
stages of software subject matter the subject matter subject matter
development
lifecycles
Express, design Demonstrate ability to Demonstrate ability to Demonstrate ability to
and evaluate perform the task perform the task perform the task to the
algorithms consistently well highest standard
Identify and use Demonstrate ability to Demonstrate ability to Demonstrate ability to
programming perform the task perform the task perform the task to the
language consistently well highest standard
constructs
Identify and use Demonstrate ability to Demonstrate ability to Demonstrate ability to
common data perform the task perform the task perform the task to the
structures consistently well highest standard
Explain and use Demonstrate Demonstrate detailed Demonstrate
common adequate ability to and coherent comprehensive, lucid
algorithms explain the subject explanation of the explanation of the subject
matter; Demonstrate subject matter; matter; Demonstrate
adequate and Demonstrate highly appropriate and
appropriate use appropriate and effective use
effective use
Explain and use Demonstrate Demonstrate detailed Demonstrate
test strategies adequate ability to and coherent comprehensive, lucid
explain the subject explanation of the explanation of the subject
matter; Demonstrate subject matter; matter; Demonstrate
adequate and Demonstrate highly appropriate and
appropriate use appropriate and effective use
effective use
Explain how Provide adequate Provide detailed and Provide comprehensive,
software is ability to explain the coherent explanation of lucid explanation of the
modularised subject matter the subject matter subject matter

Page 12 of 12
Software Development Techniques © NCC Education Limited 2019

Das könnte Ihnen auch gefallen