Software Development Techniques 05 March 2020 Examination Paper
Software Development Techniques 05 March 2020 Examination Paper
05 March 2020
Examination Paper
Answer ALL questions.
Time: 3 hours
a) Describe the FOUR (4) key steps in writing a simple computer program. 4
b) The following program code calculates the average of 10 exam marks. Copy the 4
code inserting comments in any FOUR [4] suitable places. The comments must
describe the intentions of the programmer and not simply repeat the code lines.
c) Give TWO [2] reasons why machine code is not the preferred code for 2
programming modern computers.
Total 10 Marks
Question 2
a) Various test methods are used to make sure a program works correctly. Identify 4
the method that:
i.) Assesses the flow of logic, making sure every branch of execution is tested.
ii.) Only considers the inputs and the outputs and does not look at the flow of
logic.
iii.) Uses a set of proven test cases that are applied each time a program is
altered in some way.
iv.) Tests those areas where errors are very likely to creep in because of the
transition between data values.
b) What is a test set? What does the size of a test set depend on? What does 6
running a test set involve?
Total 10 Marks
Page 2 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 3
Assuming binaryNo = “0101101101”, copy the following table and fill in the
missing values at code line 13, just before line 13 is executed.
counter binaryNo[counter] decimalNo powerOfTwo
Total 10 Marks
Page 3 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 4
a) The code below shows a loop where count is a whole number data type. State 2
whether this is a bounded or unbounded loop and explain your answer.
count = 0
Loop until count is equal to 100
count = count + 1
Next loop
b) The code below shows a loop where userInput is a string data type. State 2
whether this is a bounded or unbounded loop and explain your answer.
c) Write a bounded loop in pseudocode that fills an array of whole numbers of size 6
100 with -1. You will need to declare the variables required by this code.
Total 10 Marks
Question 5
a) Below is pseudocode that accepts two values from the user, adds them up and 5
outputs the result. It repeats this THREE (3) times. Re-write this pseudocode
using a function to remove the repetitive code and reduce the code size.
Page 4 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
i) What test method would you use to test each function individually works 1
correctly?
ii) What test method would you use to make sure all three functions 1
communicate correctly?
Total 10 Marks
Question 6
Total 10 Marks
Page 5 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 7
a) Using the information in the truth table below, fill in the missing column 6
headings with the correct compound conditionals in the table.
X Y
F F F F T T
F T F T T F
T F F T T F
T T T T F F
Fill in the missing values in the result column in the table below.
A B result
True True
False False
False True
True False
Total 10 Marks
Page 6 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 8
a) An array of whole numbers has 1000 elements. A linear search algorithm is used
to search for a number. State and explain, what is:
Total 10 Marks
Question 9
a) Discuss the differences between a stack data structure and a queue data 6
structure. In your answer, you need to include a description of differences in
how data is moved to and taken away from both data structures.
b) Fill in the missing stack contents corresponding to the listed stack operations 4
in the following table. The sequence of stack operations is from left to right. The
first cell under stack contents is filled in for you.
A, B and C are variables in which the popped numbers are stored, for example,
if top of stack contains number 1 then pop A will move number 1 into the
variable A, i.e. A = 1. If pop operation has no variable letter next to it then the
popped number is simply thrown away.
pop A, pop B
push (A + B)
Total 10 Marks
Page 7 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 10
Class Student
data name as String
data gender as Character
data bornIn as Whole number
a) Write code to create a new student object with the name “Jane Monroe”, 3
gender F and bornIn 2008. You need to first declare a correct object variable
for this.
b) The function Student has the same name as the class name and is a special 3
type of method in a class. What is this type called and what is its main purpose?
c) Functions setName and getAge are called accessor methods. Explain what an 2
accessor method is, in a class.
Total 10 Marks
End of paper
Page 8 of 8
Software Development Techniques © NCC Education Limited 2020