0% found this document useful (0 votes)
174 views8 pages

Software Development Techniques 03 September 2020 Examination Paper

Uploaded by

Yuki Ko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views8 pages

Software Development Techniques 03 September 2020 Examination Paper

Uploaded by

Yuki Ko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

TIME CONSTRAINED ASSESSMENT

Software Development Techniques

03 September 2020

Examination Paper
Answer ALL questions.

Clearly cross out surplus answers.

Time: 4 hours

The maximum mark for this paper is 100.

IMPORTANT INFORMATION

Reference material is not permitted in this assessment.


Answer ALL questions
Marks
Question 1

a) High-level computer languages are used to develop modern computer software. 4


Explain what is meant by a high-level computer language and give THREE (3)
examples of modern high-level computer languages.

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

c) Computer programs are rarely written in machine code nowadays. 2


Give TWO (2) disadvantages of writing computer programs in machine code.

Total 10 Marks

Question 2

a) The following are the various test methods used to make sure programs work
correctly. Explain the key features of each method.

i) White box testing. 1

ii) Black box testing. 1

iii) Regression testing. 1

iv) Boundary testing. 1

b) Unit testing is an important testing strategy that programmers use to ensure correct 2
operation of their programs. Explain what unit testing is and what it involves.

c) Definition of an algorithm is often written in pseudocode before coding in a 4


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

Total 10 Marks

Page 2 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 3

a) A global array, named Stack, of type whole number is used as a stack. A global 4
pointer, named SP, of type whole number is used to index the last entry in this
stack. The value of SP is initially set to -1.

A function called, Push, takes a whole number, named Val, as a parameter. It


first increments SP by one, then it stores Val in Stack in the position indexed by
SP. The following code is incomplete. Copy it and fill in the missing parts.

Function Push (needs _________)


SP = SP __________
Stack[___] = ________
End function

b) A function called, Pop, first tests if SP is greater than or equal to 0. If it is, then it 6
gets the value in Stack indexed by SP and decrements SP by one. It then returns
this value. Otherwise it outputs a suitable error message. The following code is
incomplete. Copy it and fill in the missing parts.

Function Pop () returns _________


If SP is _________ then
Val = Stack[__]
SP = SP ________
Return _______
Otherwise
Output _________
End if
End function

Total 10 Marks

Page 3 of 8
Software Development Techniques © NCC Education Limited 2020
Marks

Question 4

a) Explain the difference between bounded and unbounded loops. 4


Give ONE (1) example of a bounded loop and ONE (1) example of an
unbounded loop. In your examples you only need to give the lines that start with
a “Loop”, no other code is required.

b) Write a bounded loop in pseudocode that outputs the contents of an array of 6


whole numbers of size 100. You will need to declare any variables required by
this code.

Total 10 Marks

Question 5

a) What do the following abbreviations stand for with respect to data structures?

i.) FIFO 1

ii.) LIFO 1

b) The following numbers are pushed on an empty stack in the order 5, 10, -6, 3. 4
Copy the stack shown below and fill in with the pushed numbers.

Top

Bottom
Stack

The numbers in the stack in part (b) are then popped one by one and queued in 4
c) an empty queue until the stack is empty. Copy the queue shown below and fill in
with the numbers queued.

Head Tail

Queue

Total 10 Marks

Page 4 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 6

a) The following pseudocode uses two loops to perform a simple algorithm. The 10
variables sum, a, and b are of data type whole number. You are required to
perform desk-checking on this algorithm. Fill in the values of sum, a and b, in the
table below, when the new sum is calculated at line 6.

What name is given to a loop within another loop?

1. sum = 0
2. a = 1
3. Loop while a is less than 4
4. b=3
5. Loop until b = 0
6. sum = sum + (a * b)
7. b=b-1
8. End loop
9. a=a+1
10. End loop

sum a b

Total 10 Marks

Page 5 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 7

a) Given the following logic equation 5

(A and B) or (not A and B) = C

Fill in the truth table below.

State the relationship between C and B.

A B not A A and B not A and B C


F F
T F
F T
T T

b) The following IF statements assign values to the variable Z depending on the 4


values of the variables X and Y. All three variables are data type whole number.

if X > 0 then
Z=X
otherwise
if X = 0 and Y > 0 then
Z=0
otherwise
Z=1

Fill in the missing values in the Z column in the table below.

X Y Z
1 0
0 1
-1 0
0 0

c) State the name that is given to an if statement within another if statement. 1

Total 10 Marks

Page 6 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 8

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

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

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

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

iv) Can store several characters 2

b) Data types can be primitive or complex types. State which type is each of the
following:

i) Real number 1

ii) String 1

Total 10 Marks

Question 9

a) Big O notation is a measure of how well search algorithms scale. 4


Explain what each of the following scaling measures means and name a search
method that each corresponds to.

• O(n)
• O(log n)

b) The following numbers are stored in an array in sorted order. A binary search is 3
used to search for the number 8. Explain the steps the search algorithm will take
until the search successfully locates the number 8.

5 8 23 34 39 52 61 67 87 105 112 158 181

c) Linear-searching is a simple searching method. Explain how this method works 3


on an array.

Total 10 Marks

Page 7 of 8
Software Development Techniques © NCC Education Limited 2020
Marks
Question 10

The following is a class of type Animal with THREE (3) attributes:

Class Animal
data hasWings as Boolean
data legs as Whole number
data type as String
End Class

a) Write a constructor function that initialises all three attributes of the class 5
Animal.

b) Write the pseudo code necessary to create an Animal object called Starling with 3
the following attributes:

hasWings =True
legs = 2
type = “Starling”

You need to declare the correct object variable for this.

c) Write an accessor function called canFly that returns a True or False value 2
depending on the value of the attribute hasWings.

Total 10 Marks

End of paper

Page 8 of 8
Software Development Techniques © NCC Education Limited 2020

You might also like