Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Software Development Techniques

23rd November 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 Hotel is defined as

Class Hotel
Data Rooms as whole number
Data Address as string
Data Distance as real number

Function Hotel (needs R as whole number, A as string, D as real number)


Rooms = R
Address = A
Distance = D
End function

Function Hotel()

End function

Function GetRooms() ………………….


………………….
End function

Function SetDistance(………………….)
………………….
End function

End class

a) The function Hotel has the same name as the class name. What is such a 2
function generally known as and what is the main purpose of this function?

Mark Scheme

Constructor (1 mark)
Initialises the variables (1 mark)

Page 2 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
b) There are TWO (2) functions by the same name Hotel. 2

What are the functions with same name known as in object-oriented languages?

What feature of the TWO (2) functions uniquely distinguishes them?

Mark Scheme

Overloading / polymorphism (1 mark)


The signature / parameters (1 mark)

c) The functions GetRoom and SetDistance have missing parts. 4

Fill in the missing parts.

Mark Scheme

GetRoom:
Returns whole number (1 mark)
Return Rooms (1 mark)
SetDistance:
Needs D as whole number (1 mark)
Distance = D (1 mark)

d) What are the functions GetRoom and SetDistance generally known as in object- 2
oriented languages?

What purpose do they serve?

Mark Scheme

Accessor functions/ methods or getters / setters (1 mark)


Get/set values of variables (1 mark)
Total 10 Marks

Question 2

a) The following numbers are put in a queue: 1, -2, 5, -10, in that order.

i) What number is at the tail of the queue? 1

Mark scheme

-10 (1 mark)

ii) What number is at the head of the queue? 1

Mark scheme

1 (1 mark)

Page 3 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
iii) TWO (2) numbers are taken from the head of the queue. 2

The two numbers are then multiplied, and the result is put in the queue.

List the contents of the queue, starting from the head of the queue.

Mark scheme

-2, 5, -10 (1 mark for dequeues and multiplication, 1 mark for correct
order of the contents)

b) The following numbers are put on a stack: 1, -2, 5, -10, in that order.

i) What number is at the bottom of the stack? 1

Mark Scheme

1 (1 mark)

ii) What number is at the top of the stack? 1

Mark Scheme

-10 (1 mark)

iii) TWO (2) numbers are taken from the top of the stack. 2

The two numbers are then multiplied, and the result is put on the stack.

List the contents of the stack, starting from the top of the stack.

Mark Scheme

-50, -2, 1 (1 mark for pops and multiplication, 1 mark for correct order of
the contents)

c) What TWO (2) complex data types are normally used to be queue and stack data 2
structures?

Mark scheme

Array
List

Total 10 Marks

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

a) Below is a segment of a program composed of multiple selections. The parts of 7


the program for the selections are left out as they are not important here.

If value < 1 and value > -5 then


output(“Low range value”)
otherwise if value >= 1 and value < 5 then
output(“High range value”)
otherwise output (“Error”)

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 3)
Extreme values (maximum 2)
Bad values (maximum 2)

Marking Scheme

Test condition Test values


Transition in values (maximum 3) 0, 1, 2 (1 mark for each value,
maximum 3 marks)
Extreme values (maximum 2) -4, 4 (do not accept -5 or 5) (1
mark for each value, maximum
2 marks)
Bad values (maximum 2) Values <= -5, >= 5 (1 mark for
each value. maximum 2 marks)

Page 5 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
b) In the table below is a list of THREE (3) test methods used in testing the 3
correctness of programs. Fill in the missing parts of the test method descriptions.

Test method Test method description


Regression testing Used to test the program after ……… are made
to it
Integration testing Used to test the ……… between the main
program and its functions
Unit testing Used to test functions in …………

Mark Scheme

1 mark for each correct missing part, up to maximum 3 marks


Test method Test method description
Regression Used to test the program after
testing changes/fixes/alterations are made to it
Integration Used to test the link/communications
testing between the main program and its functions
Unit testing Used to test functions in isolation

Total 10 Marks

Question 4

a) Describe the requirements stage of Software Development Life Cycle (SDLC). 3

Which stage comes after the requirements stage?

Mark Scheme
Identifying/analysing the user requirements; (1 mark)
Writing the functional specification (1 mark)

Design is the next stage (1 mark)

b) Identify TWO (2) software development models in use today. 2

Mark Scheme

1 mark for any below, up to maximum 2 marks


Waterfall
Iterative waterfall
Prototyping
Agile methods: Scrum, Kanban, XP, DSDM, FDD, RAD, etc.

Page 6 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
c) Explain FIVE (5) goals of software development models. 5

Do not explain the individual models.

Mark Scheme

1 mark for any below, up to maximum 5 marks


Reduce/manage complexity
Produce defect free software
Conform to customer requirements
Manage expenditure/cost
Manage time/deadlines
To facilitate SDLC
(Allow any other creditable goal)

Total 10 Marks

Question 5

The following program gets the number of books from the user.

If the number is not 0 (zero), it adds this number to the total.

This is repeated until the user enters 0 (zero).

Data books as whole number


Data total as whole number

read books
if books greater than 0 then
total = total + books
read books
if books greater than 0 then
total = total + books
read books
if books greater than 0 then
total = total + books
if total ………………………

The above program is not very efficient as it stands.


You have been asked to redesign the program using an unbounded loop.

a) Explain why a loop is useful in this case and why an unbounded loop would be 3
most appropriate.

Mark Scheme
Without a loop the code will be repeated thus increasing in size (1 mark).
An unbounded loop is suitable as we don’t know when it will end (1 mark)
as it is dependent on the condition of books = 0 (1 mark).
(Accept an alternative explanation that includes the above essential
points)
Page 7 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
b) Write pseudocode that implements the above program using a loop. 5

Mark Scheme

The program should look something like (there may be other variations but
the following essential parts, in bold, must be present):

Data books as whole number


Data total as whole number

read books
Loop while books is greater than 0
total = total + books
read books
End loop

1 mark for initialising the books (e.g. first read or an assignment).


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 2 marks for correct loop contents.

c) Explain how a bounded loop differs from an unbounded loop. 2

Mark Scheme

In bounded loop it is known, in advance, when the loop will end (1 mark) as
it is counter based and not dependent on a condition (1 mark).

Total 10 Marks

Question 6

a) Below is a grid representing data in memory.

columns
0 9
0
rows

i) Declare a two-dimensional array to represent the above grid. Assume that 2


each cell of the grid represents a whole number.

Mark Scheme

Data ThisArray(5, 10) as whole number


(1 mark for correct indices, 1 mark for correct declaration format)

Page 8 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
ii) Set the element highlighted in the grid to -1. 2

Mark Scheme

ThisArray [2, 5] = -1 / ThisArray[2][5] = -1


(1 mark for correct indices, 1 mark for the assignment)

b) The following function accepts a single number as a parameter. 4

It checks to see if the number is a positive number or not.

Parts of the program are missing.

You need to identify the missing parts.

Function IsPositive (……… p as whole number) ……… Boolean


Data result as Boolean

result = false
If p is ……… than or equal to 0 then
result = true
end if
……… result
End function

Mark Scheme

1 mark for each of the following, up to maximum 4 marks


needs
returns
greater
return

c) Complete the following sentences.

i) When we pass an array to a function we do not specify its ………… . 1

Mark Scheme

size

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

Mark Scheme

Or / OR
Total 10 Marks

Page 9 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
Question 7

a) Searching and sorting of data is an important aspect of computing

i) Explain the difference between searching and sorting. 2

Mark Scheme

Searching traverses an array/list to locate the required data (1 mark).


Sorting is the process of ordering the contents of an array/list (1
mark).

ii) An algorithm that scales well is one that does not significantly increase the 4
time it takes to complete as data increases.

The following are big O notations that represent how well algorithms scale.

O(n2), O(1), O(log n), O(n)

Identify the best and the worst scaling.

Explain your reasons for your choice.

Mark Scheme

Best: O(1) (1 mark)


Time taken remains constant for all sizes of data (1mark)
Worst: O(n2) (1 mark)
Time taken increases exponentially as the size of data increases (1
mark)

b) Fill in the missing words below:

i) The simplest kind of search is the ………… search. 1

Mark Scheme

linear

ii) ………… searching requires an ordered array to work. 1

Mark Scheme

Binary

iii) The simplest form of sorting is known as ………… sorting. 1

Mark Scheme

Bubble

Page 10 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
iv) ………… splits an array into sub-arrays and sorts each individually. 1

Mark Scheme
Quicksort

Total 10 Marks

Question 8

a) Below is a logical equation: 4

R = NOT ((P AND Q) OR (P OR Q))

Copy and fill in the truth table below for the above equation.

P Q P AND Q P OR Q R
F F
F T
T F
T T

Mark Scheme

P Q P AND Q P OR Q R
F F F F T
F T F T F
T F F T F
T T T T F

1 mark for each correct row (maximum 4 marks)

Page 11 of 18
Software Development Techniques © NCC Education Limited 2022
Marks

b) A simple logic circuit has TWO (2) inputs A and B, and TWO (2) outputs C and D. 4

The inputs and the outputs are defined as following

C = NOT A AND B
D = NOT C

Draw a truth table that represents the logic of the above circuit for all
combinations of the inputs A and B.

Mark scheme

1 mark for each correct column (maximum 4 marks)

A B C D
F F F T
F T T F
T F F T
T T F T

c) Write a single if statement in pseudocode that does the following: 2

Sets the value of variable var1 to 1 (ONE) if the value of variable var2 is higher
than 0 (ZERO).

Sets the value of variable var1 to 0 (ZERO) if the value of variable var2 is not
higher than 0 (ZERO).

Mark scheme

If var2 is greater than 0 then (1 mark)


var1 = 1
otherwise (1 mark)
var1 = 0

Total 10 Marks

Page 12 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
Question 9

a) Complete the missing parts of the following statements:

i) Efficient algorithms do what they need to do in the ……………. lines of 1


code.

Mark Scheme

Minimum / smallest / shortest

ii) Loops within loops are called ……………. loops. 1

Mark Scheme

Nested

iii) Variables which are made up of other variables are ……………. data types. 1

Mark Scheme

Complex

iv) Iteration is another word for ……………. . 1

Mark Scheme

Repeating / looping

v) Calling a function means ……………. the function. 1

Mark Scheme

Running / using / invoking / executing

vi) Objects are created using the ……………. keyword. 1

Mark Scheme

New

Page 13 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
b) Write a function in pseudocode that accepts ONE (1) parameter of type whole 4
number.

The function prints the string “Yes” if the number is a negative number or prints
the string “No” if it is a positive number.

Mark Scheme

Function TestForNegative(needs Num1 as whole number)


if Num1 is less than 0 then [also accept “if Num1 < 0 then”]
output “Yes”
otherwise
output “No”
end if [may omit this line]
End function

The code written should generally solve the problem and will approximately
look like the above example. Marks can be gained from the essential
features such as the ones below:
1 mark for function structure (Function / End function)
1 mark for correct specification of the parameter
Maximum 2 marks for comparison (if, otherwise)
The indentations may be omitted. Allow for alternative pseudocode that
contains the essential ingredients as above.

Total 10 Marks

Page 14 of 18
Software Development Techniques © NCC Education Limited 2022
Marks
Question 10

a) In the following program various variables with different data types are declared.

These variables are then assigned values, but the programmer made a mistake
and assigned the values to the wrong variables.

Data a as string
Data b as whole number
Data c as real number
Data d as Boolean
Data e as character

a = 123
b = 1.23
c = “Hey”
d = ‘M’
e = True

i) Re-write the assignments, assigning the values to the correct variables. 5

You must use the same values as above.

Mark Scheme

1 mark for each correct assignment, maximum 5 marks.


a = “Hey”
b = 123
c = 1.23
d = True
e = ‘M’

ii) Explain why you made each correct assignment. 5

Mark Scheme

1 mark for each correct justification, maximum 5 marks


You can give a only a string of characters and numbers.
You can give b only decimal numbers that are not fractions.
You can give c numbers that are fractions.
You can give d only a True or a False value.
You can give e only a single character.
Total 10 Marks

End of paper

Page 15 of 18
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 16 of 18
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 17 of 18
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 18 of 18
Software Development Techniques © NCC Education Limited 2022

You might also like