
Cork Institute of Technology
Page 1 of 3
Higher Certificate in Engineering in Electronic Engineering – Award
(NFQ – Level 6)
Autumn 2006
Computer Systems & Programming
(Time: 3 Hours)
Answer ANY five questions.
All questions carry equal marks.
Examiners: Mr. D. O’Donovan
Mr. J. Berry
Dr. Ronan O Dubhghaill
1. (a) Describe the operation of the Bubble Sort algorithm. Use the list:
A F S V W Q Z X Y L
To illustrate the results after one pass of a Bubble sort in ascending order. [8 %]
(b) Write code to implement the Bubble sort algorithm in BASIC. [12 %]
2. (a) Define a user-defined data type, called ‘sample’, capable of storing two integer co-ordinates
– called amplitude and time. [4 %]
(b) Declare an array of 300 samples as defined in (a) called ‘sampleData’. [2 %]
(c) Write Visual BASIC code such that when the command Button ‘Read’ on the program form
is clicked i.e. ‘Read_click()’ event occurs, the sample data from a file called ‘c:\input.dat’ is
loaded into the array defined in (b). The data should be read until the end of file is reached.
The data is stored in the format: amplitude1, time1, amplitude2, time2, amplitude3, time3,
etc. [7 %]
(d) Write Visual BASIC code for the button ‘Average_click()’ event to calculate the average of
the amplitude values extracted from the file in (c). [7 %]