You are on page 1of 19

Software Development Techniques

08 June 2022

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.
Answer ALL questions
Marks
Question 1

The class Student is defined as

Class Student
Data Name as String
Data Gender as Character
Data Age as Whole number
Data Average as Real number

Function Student (needs myName as String, myGender as Character, myAge as


Whole number, myAverage as Real number)
Name = myName
Gender = myGender
Age = myAge
Average = myAverage
End function
End class

a) Answer the following questions:

i) What is the function Student which has the same name as the class name 1
generally known as?

Mark Scheme
Constructor

ii) What is the main purpose of the function Student? 1

Mark Scheme
It is used to initialise the class’/object’s variables
***Accept any other similar statement.

iii) Add the method printName to Student class that prints the Name attribute. 2

Mark Scheme
Function printName()
Output(Name)
End function
1 mark for method structure (brackets may be omitted)
1 mark for the output statement

Page 2 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
b) Add an accessor method to Student class that gets the student’s average. 3

Mark Scheme
Function getAverage() returns Real number
Return Average
End function
1 mark for the correct function structure (Function/End function).
1 mark for the correct return type of the function.
1 mark for the correct return statement.
*** Accept alternative function name.

c) Declare and create a new object named PGStudent with the following attributes: 3
Name = Happy Musta, Gender = M, Age = 17, Average = 65.81

Mark Scheme
Data PGStudent as Student
PGStudent = new Student (“Happy Musta”, ‘M’, 17, 65.81)
1 mark for correct object declaration
1 mark for use of the word “new”
1 mark for correct use of the attributes as parameters

Total 10 Marks

Question 2

a) In a queue data structure that stores whole numbers, the Queue operation is
used to put a number at the end (or tail) of the queue and the Dequeue operation
is used to take a number from the start (or head) of the queue.

The inputs and the outputs of the Queue and Dequeue operations can be traced
to verify that they work correctly. Answer the following questions:

i) A queue is described as a FIFO structure. State what FIFO stands for. 2


What data structure would you use as a queue?

Mark Scheme
First-In-First-Out (1 mark).
An array data structure (1 mark)- Accept List structure.

Page 3 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
ii) You test the inputs and the outputs of the Queue operation by queuing the 4
test values 0, -1, 9, -4, in that order, i.e. first 0 and last -4. Demonstrate this
by filling in the trace table below. HoQ: Head of Queue, ToQ: Tail of
Queue.

Queued Queue contents after


value queuing
HoQ ToQ
1st Queue
2nd Queue
3rd Queue
4th Queue

Mark Scheme
1 mark for each correctly filled row (maximum 4 marks)

Queued Queue contents after


value dequeuing
HoQ ToQ
1st Queue 0 0
2nd Queue -1 0 -1
3rd Queue 9 0 -1 9
4th Queue -4 0 -1 9 -4

iii) You also need to test the Dequeue operation using the final values in the 4
queue in ii) above. Demonstrate this by filling in the trace table below.

Dequeued Queue contents after


value dequeuing
HoQ ToQ
1st Dequeue
2nd Dequeue
3rd Dequeue
4th Dequeue

Mark Scheme
1 mark for each correctly filled row (maximum 4 marks)
Dequeued Queue contents after
value dequeuing
HoQ ToQ
1st Dequeue 0 -1 9 -4
2nd Dequeue -1 9 -4
3rd Dequeue 9 -4
4th Dequeue 4

Total 10 Marks

Page 4 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
Question 3

a) Below is a program that accepts a whole number and tests to see if the number 7
is an error or is a good number:

Data value as Whole number


input value
if value is less than -3 or greater than 15 then
output("Error 1")
elseif value is equal to 0
output("Error 2")
otherwise
output("Good number")
end

Fill in the test values in the table below for each type of test condition. You must
use only whole numbers as test values.

Test condition Test values


Transition in values (maximum 2)
Extreme values (maximum 2)
Wrong values (maximum 3)

Marking Scheme

Test condition Test values


Transition in values (maximum -1, 1 (1 mark for each value
2) MAX 2 marks)
Extreme values (maximum 2) -3, 15 (do not accept -4 or 16)
(1 mark for each value MAX 2
marks)
Wrong values (maximum 3) 0, -4 or <-3, 16 or > 15 (1 mark
for each value MAX 3 marks)

Page 5 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
b) In the table below is list of descriptions for THREE (3) test methods used in 3
testing the integrity of software. Fill in the names given to the each of the test
methods described.

Test method description Name given to test method


Used to test the flow of logic of
code in functions
Used to test inputs/outputs of
functions
Used to make sure different
functions work together

Mark Scheme
1 mark for each correct test name, up to maximum 3 marks
Test method description Name given to test method
Used to test the logic of code Whitebox test / Desk-checking
in functions
Used to test inputs/outputs of Blackbox test
functions
Used to make sure different Integration test
functions work together

Total 10 Marks

Question 4

a) The Software Development Life Cycle (SDLC) is a structured framework that


defines a series of development stages in the production of software.

i) Explain why there is a need for SDLC. 3

Mark Scheme
To manage software complexity (1 mark) and to facilitate production
of defect free software (1 mark) that conforms to user requirements (1
mark).

*** Accept alternative explanation as long as the key points or


equivalent (underlined) are present.

Page 6 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
ii) What are the key stages of SDLC? You need to list them in the correct 4
order.

Mark Scheme
• Requirements
• Design
• Implementation
• Testing
• Maintenance
1 mark for 2 correct
2 marks for 3 correct
3 marks for 4 correct
4 marks for 5 correct
If 5 correct stages but not in correct order, then deduct 1 mark.

b) A well-established database system has been running on old technology. There 3


is now a need for this database system to move onto the latest technology
without changing its functionality and interface.

Identify the most suitable lifecycle development model for the project and briefly
explain how it works.

Mark Scheme
A suitable development method is Waterfall model (1 mark). It has
sequential stages (1 mark) where next stage is started only after the
previous stage is completed (1 mark).
*** Accept Iterative Waterfall method.
***Accept alternative explanation containing key points as above.

Total 10 Marks

Page 7 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
Question 5

The following algorithm takes the number of newspapers delivered by THREE (3) delivery
workers and calculates the total.

Data papers1 as whole number


Data papers2 as whole number
Data papers3 as whole number
Data total as whole number

Output “Welcome to the newspaper delivery calculator”


Output “Round 1 papers:”
Input papers1
Output “Round 2 papers:”
Input papers2
Output “Round 3 papers:”
Input papers3

total = (papers1 + papers2 + papers3)


Output “The total number of newspapers delivered is:”
Output total

You have been asked to redesign the algorithm using a loop. You must decide whether to
use a bounded loop or an unbounded loop for the design of this algorithm.

a) Explain the differences between a bounded and an unbounded loop. Which type 3
of loop should be used for the above requirement?

Mark Scheme
In bounded loop we know how many times we are going to repeat the loop
(1 mark). In unbounded loop it repeats only until a logical condition is met
(1 mark).
There are 3 rounds of delivery, so bounded loop is most appropriate here (1
mark).

Page 8 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
b) Write a pseudocode that implements the above algorithm using a loop. 7

Mark Scheme
The algorithm should look something like (there may be many variations):
01 Data papers as whole number
02 Data total as whole number
03 Data counter as whole number (1 mark)
04 Counter = 0 (1 mark)
05 papers = 0
06 output “Welcome to the newspaper delivery calculator”
07 Loop until counter is equal to 3
08 Output “Type in number of newspapers:”
09 Input papers
10 total = total + papers
11 Counter = counter + 1
12 Next loop
13 Output “The total number of newspapers is:”
14 Output total
15 Output “Thank you for using this program.”

1 mark for declaration of a counter.


1 mark for initialising a counter.
Up to 2 marks for correct structure of loop statement (if correct structure
award 2 marks; if partially correct then award 1 mark).
Up to 3 marks for correct loop contents (highlighted).
The pseudo code does not need to be exact, but it needs to solve the
problem.

Total 10 Marks

Question 6

a) An array variable is declared as


Data anArray (X, 100) as Whole number

i) If the array anArray can store a maximum of 1500 whole numbers, then 2
what is the value of X? You must show how you arrived at the answer.

Mark Scheme
X = 1500 / 100 (1 mark)
X = 15 (1 mark)

ii) What type of array is anArray? 1

Mark Scheme
Multi-dimensional / two-dimensional

Page 9 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
b) Below is a program that stores -1 in all elements of the array myArray. However, 5
the programmer left out some parts of the program. Fill in the missing parts (you
can write down only the lines that need completing).

Data myArray (120) as whole number


Data counter as ............

counter = ............
Loop ............counter is equal to sizeof(myArray)
myArray(............) = -1
counter = counter ............1
End loop

Mark Scheme
1 mark for each of the following, up to maximum 5 marks
Whole number
0
Until
Counter
+

c) Complete the following sentences.

i) Functions give us a way to greatly reduce the ………… of our programs. 1

Mark Scheme
Size / complexity

ii) The logical operator ………… means both conditions must be true to give a 1
result of true.

Mark Scheme
And / AND

Total 10 Marks

Question 7

a) In searching and sorting algorithms, the Big O notation is a measure of how well
an algorithm scales.

i) Explain what is meant by the word scales in the above statement. 2

Mark Scheme
The Big O notation is a measure of how the time of a search or a sort
increase (1 mark) as the size of data increases (1 mark).
***Accept a similar description

Page 10 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
ii) What is the Big O notation for an algorithm that has constant scaling for 1
any size of data?

Mark Scheme
O (1) (1 mark)

iii) What is the Big O notation for an algorithm that has scaling directly 1
proportional (linearly) to the size of data?

Mark Scheme
O (n) (1 mark)

b) Below is the pseudocode of a sorting algorithm. The variable nums is an array of


whole numbers that stores the numbers to sort. The variable swapped is a
boolean variable and the variables counter and temp are whole numbers.

01 swapped = true
02 loop while swapped is true
03 counter = 0
04 swapped = false
05 loop while counter is less than sizeof(nums) - 1
06 if nums[counter] is greater than nums[counter+1] then
07 temp = nums[counter]
08 nums[counter] = nums[counter +1]
09 nums[counter+1] = temp
10 swapped = true
11 end if
12 counter = counter+1
13 next loop
14 next loop

i) Identify what this sorting method is and state what the order of the sorting 2
is (i.e. descending or ascending).

Mark Scheme
This is bubble-sort (1 mark). It is sorting in ascending order (1 mark).

ii) Explain, in general terms and in one sentence, the main purpose of the
code between lines 6 and 11.
2
Mark Scheme
Lines 6 to 11 are checking to see if the next number is smaller than
the present one (1 mark) and if it is, the two numbers are swapped (1
mark).

Page 11 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
iii) What is the Big O notation of this sorting algorithm? 1

Mark Scheme
O(n2) (1 mark).

iv) State, in one sentence, the purpose of the first loop. 1

Mark Scheme
Repeats until all numbers are sorted / until no swapping is required (1
mark).
***Do not accept “loops until swapped is true”.

Total 10 Marks

Question 8

a) A rule in Boolean logic states the following fact:

(not X) or (not Y) = not (X and Y)

i) Copy and fill in the table below to show that the above rule is correct for all 5
combinations of logic values of X and Y.

X Y not X not Y (not X) or (not Y) X and Y not (X and Y)


F F
F T
T F
T T

Mark Scheme

X Y not X not Y (not X) or (not Y) X and Y not (X and Y)


F F T T T F T
F T T F T F T
T F F T T F T
T T F F F T F
1 mark for each correct column (maximum 5 marks)

ii) Which two columns show that the above rule is correct? 1

Mark Scheme
The 5th and the 7th columns are the same (1 mark)

Page 12 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
b) The following if statements assign values to the variable Q depending on the 4
values of the variable P. Both variables P and Q are of data type whole number.

if P < 0 then
Q = -1
otherwise
if P >= 1 and P <= 5 then
Q = 1
otherwise
Q = 0
end if
end if

Fill in the missing values in the Q column in the table below for each value in the
P column.

P Q
-1
0
1
6

Marking scheme
1 mark for each correct entry in the Q column (maximum 4 marks)
P Q
-1 -1
0 0
1 1
6 0

Total 10 Marks

Page 13 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
Question 9

a) The following table lists descriptions of SIX (6) qualities of a good algorithm. In 6
the Qualities column, add the corresponding quality from the choices listed
below:

Robust Documented Maintainable Complete Efficient Readable

Description of qualities Qualities


It contains the steps required to arrive at a desired
conclusion.
It can deal with unlikely situations and incorrect
data.
It accomplishes its task in the minimum number of
steps.
When people look at the algorithm, they can
understand what it is doing.
If changes need to be made in the future, the
algorithm can be changed easily.
There are instructions for people who wish to make
use of the algorithm.

Mark Scheme
1 mark for each correct order up to maximum 6 marks

Description of qualities Qualities


It contains the steps required to arrive at a Complete
desired conclusion.
It can deal with unlikely situations and incorrect Robust
data.
It accomplishes its task in the minimum number Efficient
of steps.
When people look at the algorithm, they can Readable
understand what it is doing.
If changes need to be made in the future, the Maintainable
algorithm can be changed easily.
There are instructions for people who wish to Documented
make use of the algorithm.

Page 14 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
b) Write a function called AddNumbers in pseudocode that takes two whole 4
numbers, Num1 and Num2, as parameters, adds them up and returns the result
as a whole number. You should use the names above in your pseudocode.

Mark Scheme
Function AddNumbers (needs Num1 as whole number, Num2 as whole
number)
returns whole number
return (Num1 + Num2)
End function

1 mark for function structure (Function / End function)


1 mark for parameter specification
1 mark for function return specification
1 mark for correct return statement
Allow for alternative pseudocode that contains the essential ingredients as
above.

Total 10 Marks

Question 10

a) Identify the data type that can store the kind of data described by the following
statements and give ONE (1) example of data in each case.

i) Can store negative and positive numbers that are not fractions. 2

Mark Scheme
Whole number / integer (1 mark)
Any integer example (Do not allow a decimal example) (1 mark)

ii) Can store numbers that can include negative or positive fractions. 2

Mark Scheme
Real number / float / decimal (1 mark)
Any decimal number example (Do not allow an integer example) (1
mark)

iii) Can store only one of two possible logical values. 2

Mark Scheme
Boolean (1 mark)
False / true (Do not allow any non-logical example) (1 mark)

Page 15 of 19
Software Development Techniques © NCC Education Limited 2022
Marks
iv) Can store several alpha-numeric characters 2

Mark Scheme
String (1 mark)
Any string including letters, numbers, symbols, or combination of (1
mark)

v) Can store a single letter. 2

Mark Scheme
Character (1 mark)
Any single letter by itself or within ‘’ delimiters (Do not allow
character within “” delimiters) (1 mark)

Total 10 Marks

End of paper

Page 16 of 19
Software Development Techniques © NCC Education Limited 2022
Learning Outcomes matrix

Question Learning Outcomes Marker can differentiate


assessed between varying levels of
achievement
1 LO3, LO7 Yes
2 LO4 Yes
3 LO6 Yes
4 LO1 Yes
5 LO2, LO3 Yes
6 LO3 Yes
7 LO5 Yes
8 LO3 Yes
9 LO2, LO3 Yes
10 LO3 Yes

Grade descriptors

Learning Fail Referral Pass Merit Distinction


Outcome
Identify and Provides an Provides an Provides a Provides a very Provides an
explain the incorrect inadequate satisfactory good excellent to
interpretation of interpretation of interpretation of interpretation of outstanding
key stages of an authoritative one or two several a variety of interpretation of
software source, authoritative authoritative authoritative numerous
development therefore sources and sources to meet sources that authoritative
lifecycles inadequately therefore the requirements goes beyond the sources to
addressing ineffectively of problems that minimum critically address
problems that addresses are well defined requirements to problems that
are well defined problems that but non-routine. address are well defined
but non- are well defined problems that but non-routine.
routine. but non-routine. are well defined
but non-routine.
Express, Demonstrates Demonstrates an Demonstrates a Demonstrates a Demonstrates an
design and little to no ability extremely limited satisfactory very good ability excellent ability
to adequately ability to ability to use to use design to use design
evaluate use design adequately use design principles principles to principles to
algorithms principles to design principles to effectively effectively create effectively create
effectively to effectively create and and accurately and critically
create an create an adequately evaluate an evaluate an
artefact to solve artefact to solve evaluate an artefact to solve artefact to solve
an identified an identified artefact to solve an identified an identified
issue. issue. an identified issue. issue.
issue.
Identify and Demonstrates Demonstrates an Demonstrates a Demonstrates a Demonstrates an
use little to no ability extremely limited satisfactory very good ability excellent ability
to adequately ability to ability to review to review the to
programming review the adequately the effectiveness effectiveness comprehensively
language effectiveness review the and and review the
constructs and effectiveness appropriateness appropriateness effectiveness
appropriateness and of information of information and
of information appropriateness and data due to and data that appropriateness
and data by of information adequate use of goes beyond the of information

Page 17 of 19
Software Development Techniques © NCC Education Limited 2022
failing to use and data due to pre-defined minimum and data due to
pre-defined insufficient use techniques required to pass a meticulous use
techniques of pre-defined and/or criteria. due to an of pre-defined
and/or criteria. techniques accurate use of techniques
and/or criteria. pre-defined and/or criteria.
techniques
and/or criteria.
Identify and Demonstrates Demonstrates an Demonstrates a Demonstrates a Demonstrates an
use common little to no ability extremely limited satisfactory very good ability excellent ability
to adequately ability to ability to review to review the to
data review the adequately the effectiveness effectiveness comprehensively
structures effectiveness review the and and review the
and effectiveness appropriateness appropriateness effectiveness
appropriateness and of information of information and
of information appropriateness and data due to and data that appropriateness
and data by of information adequate use of goes beyond the of information
failing to use and data due to pre-defined minimum and data due to
pre-defined insufficient use techniques required to pass a meticulous use
techniques of pre-defined and/or criteria. due to an of pre-defined
and/or criteria. techniques accurate use of techniques
and/or criteria. pre-defined and/or criteria.
techniques
and/or criteria.
Explain and Incorrectly Inconsistently Can adequately Can Can consistently
use common identifies, identifies, adapts identify, adapt appropriately identify, adapt
adapts and and makes use and make use of identify, adapt and make use of
algorithms makes use of a of a limited a sufficient range and make use of a comprehensive
deficient range range of of techniques a range of range of
of techniques or techniques or and information techniques and techniques and
information information sources within information information
sources within sources within an array of sources within sources within
an array of an array of contexts. an array of an array of
contexts. contexts. contexts with contexts with
depth that goes depth.
beyond the
minimum to
pass.
Explain and Demonstrates Demonstrates an Demonstrates a Demonstrates a Demonstrates an
use test little to no ability extremely limited satisfactory very good ability excellent ability
to adequately ability to ability to review to review the to
strategies review the adequately the effectiveness effectiveness comprehensively
effectiveness review the and and review the
and effectiveness appropriateness appropriateness effectiveness
appropriateness and of information, of information, and
of information, appropriateness data and results data and results appropriateness
data and results of information, due to adequate that goes of information,
by failing to use data and results use of pre- beyond the data and results
pre-defined due to defined minimum due to a
techniques insufficient use techniques required to pass meticulous use
and/or criteria. of pre-defined and/or criteria. due to an of pre-defined
techniques accurate use of techniques
and/or criteria. pre-defined and/or criteria.
techniques
and/or criteria.
Explain how Provides an Provides an Provides a Provides a very Provides an
software is incorrect inadequate satisfactory good excellent to
interpretation of interpretation of interpretation of interpretation of outstanding
modularised an authoritative one or two several a variety of interpretation of
source, authoritative authoritative authoritative numerous
therefore sources and sources to meet sources that authoritative
inadequately therefore the requirements goes beyond the sources to
Page 18 of 19
Software Development Techniques © NCC Education Limited 2022
addressing ineffectively of problems that minimum critically address
problems that addresses are well defined requirements to problems that
are well defined problems that but non-routine. address are well defined
but non- are well defined problems that but non-routine.
routine. but non-routine. are well defined
but non-routine.

Page 19 of 19
Software Development Techniques © NCC Education Limited 2022

You might also like