SDT Spring Exam 2023 QP Final
SDT Spring Exam 2023 QP Final
Time: 4 hours
Name as a String
IsBitter as Boolean
Colour as String
a) Write a constructor method for the class Fruit that initialises all THREE (3) 5
variables. You must write your code in pseudocode only.
b) Write an accessor method for the class Fruit that queries the Colour of a fruit. You 3
must write your code in pseudocode only.
c) Write the pseudocode that sets the Colour attribute of object Apple of type Fruit to 2
green. Assume that the object Apple is already created.
Total 10 Marks
Question 2
a) A word processor can carry out operations such as editing, deleting and adding text. It
can also undo them in the order they are carried out.
i) Identify the data structure most suitable for the word processor to undo 1
operations.
ii) Explain how undo works using the data structure you identified. 3
b) The numbers 1, 2, 3 and 4 are pushed onto a stack data structure in that order, i.e.,
first number 1 and last number 4.
Page 2 of 8
Software Development Techniques © NCC Education Limited 2023
Marks
iii) TWO (2) numbers are popped from the stack, one after the other. 1
The TWO (2) numbers are multiplied, and the result is pushed onto the stack.
What numbers are now on the stack, starting from the top of stack.
c) The numbers 1, 2, 3 and 4 are put in a queue data structure in that order, i.e., first
number 1 and last number 4.
iii) TWO (2) numbers are taken from the queue, one after the other. 1
The TWO (2) numbers are multiplied, and the result is put in the queue.
What numbers are now in the queue, starting from the start of queue.
Total 10 Marks
Question 3
a) A function has been written which only accepts a whole number as a single
parameter.
The valid numbers are expected to be between, and including, -5 and 10. However,
zero is not accepted as a valid number.
i) What values would you use to test for transition in values (maximum 2)? 2
ii) What values would you use to test for extreme values (maximum 2)? 2
iii) What values would you use to test for numbers that are not valid numbers 3
(maximum 3)?
b) In Question 3b) you need to describe the main features of THREE (3) types of test
methods.
Total 10 Marks
Page 3 of 8
Software Development Techniques © NCC Education Limited 2023
Marks
Question 4
a) The Requirements stage of the Software Development Life Cycle (SDLC) is the 4
first stage of this cycle and the cheapest to complete. Explain what is produced in
the Requirements stage. Then, identify the most expensive stage and state why it
is the most expensive?
Explain how the ‘iterative’ version gets round this inflexibility and why this may be
needed.
Total 10 Marks
Question 5
A program is required to add together a sequence of positive whole numbers input by the
user. This repeats until the user enters a negative number.
You must first decide whether to use a bounded loop or an unbounded loop.
a) Explain which type of loop you should use for the above program and why. 2
Total 10 Marks
Page 4 of 8
Software Development Techniques © NCC Education Limited 2023
Marks
Question 6
ii) You wish to assign a value to the last element of this array. Note that both 2
the row and the column indices start from ZERO (0).
i) White-box testing 1
▪ Communicate with it
▪ Use or execute it
▪ Reuse it
Page 5 of 8
Software Development Techniques © NCC Education Limited 2023
Marks
iii) The quick sort 1
iv) An object 1
▪ Is an instance of a class
▪ Is a keyword
i) Classes have both variables for data and ………… for algorithms. 1
Total 10 Marks
Question 7
a) An algorithm is searching an array for a number that is stored in the array. The 3
algorithm is using linear search method.
Describe the main steps the algorithm goes through until it locates the number.
b) Consider the linear search in a) above and answer the following questions
i) The average case of number of searches is 1200. What is the size of this 1
array?
Page 6 of 8
Software Development Techniques © NCC Education Limited 2023
Marks
c) Fill in the missing words in the following sentences.
iii) Sorting numbers starting with the smallest to the largest is called sorting in 1
………… order.
iv) Bubble sort checks adjacent pairs and ………… them if they are not in 1
required order.
Total 10 Marks
Question 8
var1 is assigned the value of ZERO (0) if var2 has a value higher than
ZERO (0).
If var2 is not higher than ZERO (0), then var1 is assigned the value of 1.
TRUE
Total 10 Marks
Page 7 of 8
Software Development Techniques © NCC Education Limited 2023
Marks
Question 9
State ONE (1) reason why the above statement is a useful advice.
i) What is a function? 1
iii) Describe how a function can receive data from the main program. 1
iv) Describe how a function can pass data to the main program. 1
Total 10 Marks
Question 10
Determine what data type each of the above variables should be and state the
reason for choosing each type.
Total 10 Marks
End of paper
Page 8 of 8
Software Development Techniques © NCC Education Limited 2023