Docsity

USER-DEFINED DATA TYPE - Computer Systems and Programming - Exam, Exams of System Programming

Toggle sidebar
bg1
Cork Institute of Technology
Page 1 of 4
Higher Certificate in Engineering in Electronic Engineering – Award
(NFQ – Level 6)
Summer 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. R. O’Dubhghaill
Q1. (a) Discuss the benefit of using arrays in programming. [4 %]
(b) Illustrate, using diagrams, the operation of the Binary Search algorithm by locating 20 using
the numbers:
1 5 7 8 10 15 20 23 25 40 [6 %]
(c) Write BASIC code to implement the Binary Search algorithm [10 %]
Q2. (a) Explain the purpose and benefit of the USER-DEFINED DATA TYPE in BASIC. [2 %]
(b) Define an abstract data type called ‘userData’ capable of storing the customer details for a
video library. The details should include the following:
• Name
• Address
• Video Title
• Rental Price
• Rental Date [4 %]
(c) Define an array of 100 userData, called customers, as defined in (b) above. [2 %]
(Continued over)
pf3
pf4

Partial preview of the text

Download USER-DEFINED DATA TYPE - Computer Systems and Programming - Exam and more Exams System Programming in PDF only on Docsity!

Cork Institute of Technology

Higher Certificate in Engineering in Electronic Engineering – Award

(NFQ – Level 6)

Summer 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. R. O’Dubhghaill

Q1. (a) Discuss the benefit of using arrays in programming. [4 %]

(b) Illustrate, using diagrams, the operation of the Binary Search algorithm by locating 20 using the numbers: 1 5 7 8 10 15 20 23 25 40 [6 %] (c) Write BASIC code to implement the Binary Search algorithm [10 %]

Q2. (a) Explain the purpose and benefit of the USER-DEFINED DATA TYPE in BASIC. [2 %]

(b) Define an abstract data type called ‘userData’ capable of storing the customer details for a video library. The details should include the following:

  • Name
  • Address
  • Video Title
  • Rental Price
  • Rental Date [4 %]

(c) Define an array of 100 userData, called customers, as defined in (b) above. [2 %]

(Continued over)

(d) Assume a command button ‘Add’ exists. Place Visual Basic code in the Add_click() event to: i. Add a customer details to the array from textboxes with the corresponding name: txtName → Name, txtAddress → Address,txtVideoTitle → videoTitle, txtRentalPrice → rentalPrice and txtRentalDate → rentalPrice. The array position should be tracked by a variable in the general declarations section of the form. ii. Using another command button event ‘Store_click’, write Visual Basic code to place the array contents to a text file called ‘c:\customers.dat’. iii. In the ‘Search_click’ event, write code to locate a customer with a Name of ‘John Smith’. [12 %]

Q3. (a) Describe the Program Development Stages ( or Development Life Cycle ) as it applies to Visual Basic. [5 %]

(b) Write a Visual Basic program which resembles Figure 3.1. The program should possess the following functionality: i. Uses the ‘Add’ (cmdAdd_Click() event) button to add text from the textbox (text1) to the listbox (list1). [2 %] ii. The Add button should also alter the maximum value of the scroll bar to reflect the total number of items currently in the list box. [3 %] iii. Clicking on the scrollbar should select the position in the listbox list that the current value of the scrollbar represents. [5 %] iv. Add an ‘Edit’ button which will replace the currently selected item in the listbox with the text in the textbox (text1). [5 %] The events involved are: Private Sub vScrollAdd_Change() and Private Sub cmdAdd_Click()

Q5. Describe any 3 of the following computer architecture concepts:

o Pipelining o SuperScalar architecture o RISC o Microcode [20 %]

Q6. (a) Briefly discuss two of the following characteristics of data networks:

o Bus LANs o Ring LANs o Intranet [8 %] (b) Discuss 3 of the following Technologies with regards to internet connections: o Fibre optics o Copper lines o ADSL o VDSL [12 %]