SDT June 2018 Exam - Final 8412

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

Software Development Techniques

7 June 2018

Examination Paper
Answer ALL questions.

Clearly cross out surplus answers.

Time: 3 hours

The maximum mark for this paper is 100.

Any reference material brought into the examination room must be


handed to the invigilator before the start of the examination.
Answer ALL questions

Marks
Question 1

You have been asked to develop an application for a client. The application has the
following requirements:

• This application will be highly portable.


• This application may need many changes during development.
• There is no requirement for speed of execution for this application.

a) Explain FOUR (4) differences between compiled and interpreted languages. 8

b) Based on the information above, recommend the appropriate choice of 2


language for this development and give ONE (1) reason for your
recommendation.

Total 10 Marks

Question 2

The waterfall model is a traditional approach to software development that has a number
of stages. During the design stage we may use pseudocode to develop our algorithms.

a) Explain the term pseudocode and why we might use it to design algorithms. 4

b) Name and describe ONE (1) alternative representation that we could use to 2
help design algorithms.

c) List and explain TWO (2) properties of a good algorithm. 4

Total 10 Marks

Page 2 of 7
Software Development Techniques © NCC Education Limited 2018
Marks
Question 3

The following algorithm takes the number of newspapers delivered on three 10


delivery rounds and calculates the total. Perform a desk-check on this algorithm
using a table to show the values in each variable after the execution of each line.

Assume an input value of 250 for papers1; 150 for papers2 and 200 for
papers3. Include notes in the desk check to explain each line of pseudocode.

1. data papers1 as whole number


2. data papers2 as whole number
3. data papers3 as whole number
4. data total as whole number
5. output “Welcome to the newspaper delivery calculator”
6. output “Round 1 papers:”
7. input papers1
8. output “Round 2 papers:”
9. input papers2
10. output “Round 3 papers:”
11. input papers3
12. total = (papers1 + papers2 + papers3)
13. output “The total number of newspapers delivered is:”
14. output total
15. output “Thank you for using this program.”

Total 10 Marks

Question 4

a) The correct choice of data type is important during software design and 4
implementation. Discuss FOUR (4) factors that affect the choice of data type
during software design.

b) Choose a data type for each of the following and explain why you have done so.

i) The staff ID of a delivery worker 2

ii) The phone number of a customer 2

iii) The total cost of a customer order 2

Total 10 Marks

Page 3 of 7
Software Development Techniques © NCC Education Limited 2018
Marks
Question 5

The following algorithm takes the number of newspapers delivered by three delivery
workers, and calculates the total.

1. data papers1 as whole number


2. data papers2 as whole number
3. data papers3 as whole number
4. data total as whole number
5. output “Welcome to the newspaper delivery
calculator”
6. output “Round 1 papers:”
7. input papers1
8. output “Round 2 papers:”
9. input papers2
10. output “Round 3 papers:”
11. input papers3
12. total = (papers1 + papers2 + papers3)
13. output “The total number of newspapers delivered
is:”
14. output total
15. output “Thank you for using this program.”

You have been asked by your employers 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. 2

b) Explain which type of loop should be used for the above requirement and why 2
a)the alternative should not be chosen.

c) Write a short pseudocode algorithm that implements the above algorithm using 6
a bounded loop.

Total 10 Marks

Page 4 of 7
Software Development Techniques © NCC Education Limited 2018
Question 6

a) In a program to record the bonus awarded to delivery workers at the International 8


Newspaper Corp, we use three variables: papers, status, and distinction.

Using an if statement, write a pseudocode algorithm that implements the


following rules:

- If a worker has delivered 600 papers or more then their status variable
becomes “good”.
- If a candidate has a score of less than 600 papers then their status variable
field becomes “normal”.
- If a candidate has a score of 800 papers or more, then their distinction
variable is set to “Y” and the variable outputString is set to “with distinction”

b) Explain what boundary testing is and why it is important for if statements. 2

Total 10 Marks

Question 7

a) Below is a partly complete truth table for the logical equation: 10


NOT (A AND (B OR C)).

Complete the table.

A B C B OR C A AND (B OR C) NOT (A AND (B OR C))

F F F F

F F T T

F T F T

F T T T

T F F

T F T

T T F

T T T

Total 10 Marks

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

a) Write an algorithm that steps through the elements of an array of cricket scores 10
(stored as whole numbers). If your program finds a score that is 100 or more,
then it will add 1 to a variable called “centuries”.

The array of scores may be any length so your algorithm will use a pre-defined
function called length() to return the length of the array. The function length() is
used as follows:

function length(needs score as whole number) returns whole


number

Total 10 Marks

Question 9

a) Explain what is meant by the term “recursive algorithm”. 3

b) Briefly explain the Quicksort algorithm and the Bubblesort algorithm. 4

c) Explain why the Quicksort algorithm is recursive, but the Bubblesort algorithm is 3
not.

Total 10 Marks

Page 6 of 7
Software Development Techniques © NCC Education Limited 2018
Question 10

a) Using an appropriate example, explain the concept of Inheritance in object- 7


oriented programming.

b) The following class is used to describe objects of type employee in a newspaper 3


delivery organisation. The class contains two member variables, and their
associated accessor functions, but some of the details are missing.

Complete the missing parts of the class below:

Class Employee
data balance as whole number
data name as string

function setDeliveryRound (needs d as Whole Number)


deliveryRound = d
end function

function setName (needs n as string)


name = n
end function

function getDeliveryRound() returns Whole Number


return deliveryRound
end function

function getName() returns String


return name
end function

End Class

Total 10 Marks

End of paper

Page 7 of 7
Software Development Techniques © NCC Education Limited 2018

You might also like