Heq Apr24 Cert Software development
Heq Apr24 Cert Software development
The marks given in brackets are indicative of the weight given to each part of the question.
B11.
Compare and contrast the following pairs of related terms:
Calculators are NOT allowed in this examination.
a) White box testing vs black box testing.
(4 marks)
B12.
Compare and contrast the following pairs of related terms: You should include a clear
explanation of the purpose of each.
a) Compiler vs Interpreter.
(4 marks)
b) Linker vs Loader.
(4 marks)
END OF EXAMINATION
Page 8 of 8
Section A B9.
Answer two questions (out of four). Each question carries 30 marks. a) Consider Fig B9 below, an example of a stack, where top indicates the current
position of the top of the stack.
c) Write code to show how each of the four steps in the algorithm above could be Redraw Fig B9 to show the result of the following operations:
implemented as a separate function. You should also provide sample code to call
these functions to calculate the wage or to display a suitable error message. i. Push(21)
(10 marks) ii. Push(10)
iii. Pop.
d) What are the general advantages of breaking program code into separate (2 marks)
functions?
(5 marks) b) Describe each of the following data structures, including how each data structure
manipulates data (specifically insertion and deletion). Provide examples with
diagrams to assist your answer.
A2.
a) Consider an array of positive and negative numbers. Using this array, write code i. Array
in a language of your choice to achieve the following: ii. Linked List.
(8 marks)
i. Output the entire contents of the array using a ‘for loop’.
c) Give ONE reason why a linked list is preferred to an array in some applications.
ii. Double each number in the array. Save the resulting array called (2 marks)
doubleNums.
iii. Use a filter to generate a new array containing the positive numbers in
your original array.
b) What is the difference between a stack and a queue? Give examples of situations
where each of these might be used.
(7 marks)
c) Explain how a binary search could be used to find the position of a specific item
in a sorted array.
(7 marks)
[Turn Over]
Page 2 of 8 Page 7 of 8
B6. A3.
a) List and describe FOUR advantages of an object-oriented approach to a) Using a programming language of your choice, write sample code to ask the user
programming. a question then store their answer in a file.
(8 marks) (6 marks)
b) Describe the main characteristics of the functional programming paradigm. b) Explain the difference between sequential and random-access files and how
(4 marks) each of these is supported in a programming language of your choice.
(6 marks)
B7. c) Explain how comma separated value (CSV) files can be used to help share data
There are many file formats that structure data in different ways. The file extension (for between applications. Your explanation should include examples of situations
example *.jpg; *.pdf; *.html; *.csv; *.txt) determines the file format. where these are often used.
(6 marks)
a) Why is it important to know the file format before accessing data from such a file?
(2 marks) d) How can abstract data types be used to make programs easier to understand?
(6 marks)
b) Describe the file format that each of the FIVE file extensions listed above
represents. e) Explain the difference between an abstract data type and an abstract class as
(10 marks) used in object-oriented programming.
(6 marks)
B8.
A popular type of user interface is based on a web form where the user fills in certain
details that are required and submits the details to the web server for processing.
b) List FOUR types of GUI objects that could be used on a web form. Outline the
overall function of each control.
(4 marks)
c) Draft out a design of a web form user interface to your chosen application that uses
FOUR types of GUI objects. Justify each type of GUI object you used.
(5 marks)
[Turn Over]
Page 6 of 8 Page 3 of 8
A4. Section B
a) Roman numerals are represented by seven different symbols: I, V, X, L, C, D and Answer five questions (out of eight). Each question carries 12 marks.
M. These have the following meanings in denary:
Roman numerals are usually written largest to smallest from left to right. For
example: Where n is the number of values in a dataset and xi is the ith element in a list.
The above formula can be expressed in expanded form as follows:
MDCIII means 1000+500+100+3 = 1603
MAD = (abs(x1–mean) + abs(x2–mean) + abs(x3–mean) …. abs(xn–mean) ) / n
However, the numeral for four is not IIII. Instead, the number four is written as IV.
Because the one is before the five, we subtract it making four. The same principle
Where the function abs() returns the absolute value of its argument
applies to the number nine, which is written as IX. There are six instances where
subtraction is used:
a) Write out the steps needed to calculate the MAD. Show the result of applying each
step to the data set {2, 6, 13,7}.
I can be placed before V (5) and X (10) to make 4 and 9.
(4 marks)
X can be placed before L (50) and C (100) to make 40 and 90.
C can be placed before D (500) and M (1000) to make 400 and 900.
b) Assume that a program called main() is provided containing the following
pseudocode:
i. Given a roman numeral, explain how you would design a program to
convert it to a denary integer. You do not need to write actual code but main()
clearly present an algorithm that would solve this problem. Declare float arr[] = { 34,21,56,76,45,11}
(8 marks) Declare int n = sizeof(arr)
Call fnDeviation(arr[], n)
ii. Given an integer in denary, explain how you would design a program to
convert it to a roman numeral. Again, you do not need to write actual code i. Write pseudocode for a function called fnMean(arr[ ],n) that returns the
but clearly present an algorithm that would solve this problem. mean of n values contained in an array named arr[ ].
(7 marks) (4 marks)
b) A string is a variable that holds a sequence of one or more alphanumeric ii. Write pseudocode for a function called fnDeviation(arr[ ],n) that returns
characters. These characters can be letters, numbers or symbols. It is usually the Mean Absolute Deviation of the n values contained in an array named
possible to manipulate a string to provide information or to alter the contents of a arr[ ].
string. Most programming languages include string functions to help with this.
Hint: The fnMean( ) needs to be incorporated in fnDeviation( ).
For a programming language of your choice, explain how each of the following (4 marks)
string functions is supported. You should provide an illustrative example of how
each function could be used:
i. Length
ii. Character position
iii. Substring
iv. Concatenation
v. String conversion.
(15 marks)
[Turn Over]
Page 4 of 8 Page 5 of 8