



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Semester 1 Examinations 2010
Module Code: COMP
School: Electrical and Electronic Engineering
Programme Title: Bachelor of Engineering in Electronic Engineering
Programme Code: ELES_L7_Y
External Examiner(s): Dr. A. Donnellan, Mr. I. Kennedy Internal Examiner(s): Donal OâDonovan
Instructions: All questions must be answered
Practical Section: Console and Windows: ďˇ Using a PC with the Visual Basic.NET programming environment, complete the exercises indicated. [Examination percentage: 45 %]
Instructions: (a) Each program should be stored in a separate project folder. (Select the âCreate new folderâ option when creating the project.) (b) The project name should be formatted as follows: o âname question numberâ, e.g., John_Smith_Q (c) The final projects should be copied to a machine designated by the invigilator at the end of the examination. o It is the studentâs responsibility to verify the correct transfer of the project files to the invigilatorâs machine. (d) The VB.NET code for each program should also be printed off and inserted into your answer book (see Theory Section). Your name and question number should be clearly marked on each print-out page.
Theory Section: ďˇ A hand-written response is required for these questions. [Examination percentage: 55 %] Instructions: ďˇ All questions should be answered in answer book provided.
NOTE: This is a closed-book examination. Although, you may use the help supplied by the Visual Basic programming environment, if you wish.
Duration: 2 hours
Sitting: Autumn 2011
Requirements for this examination:
Note to Candidates: Please check the Programme Title and the Module Title to ensure that you have received the correct examination paper. If in doubt please contact an Invigilator.
PC with Microsoft Visual Studio 2010 (or equivalent)
2. Construct the user interface shown in Figure 1 using the Windows-based Visual Basic.NET programming project.
Figure 1
The user interface should operate as follows:
(a) When the form initially loads, set the â1 secâ option to âselectedâ. [2 %]
(b) Text is entered in the textbox, located to the left of the âAdd to Listboxâ button. Clicking the âAdd to Listboxâ button should insert the typed text into the Listbox, âListDataâ. [3 %]
(c) Clicking the âFlash Selected Textâ button should operate as follows: i. The timer should insert the text selected in the ListData listbox into âDisplay Labelâ. [4 %] ii. If no text is selected in ListData, a message box should appear informing the user to select text from the listbox first. [4 %] ii. Activate a timer initially set to 1 second. [2 %] iii. âFlashâ the âdisplay labelâ using alternate colours of your choice at the rate selected by the âhalf secâ and â1 secâ options. [4 %]
(d) Add a menu bar to your application with one menu called âFileâ and insert an option to âQuitâ the program into the File submenu. [3 %]
In an examination booklet, answer the following:
(b) i. Explain why dynamic array reallocation, using the âreDimâ command is a useful mechanism. Demonstrate how the first and second dimensions of a 2-dimensional (2-D) array may be resized from a size of 3 by 6 to a size of 7 by 15, respectively. [6 %]
ii. Write a function definition illustrating how a 2-D array may be passed as an argument to a function. The function should display each element of the 2-D array in turn. [8 %]
(c) i. Define a user-defined data type, called âstructExpâ, capable of storing a string, an integer and an array of 10 doubles. [5 %]
ii. Explain what must be done with the array of doubles in (c) i. to enable structExp to be used in a program. [3 %]
iii. Declare an array of structExpâs of size 100. Demonstrate how data may be inserted into each element of the 35th^ element of the array. [7 %]
(d) Using diagrams to illustrate your answer, give a detailed explanation of the operation of the âSelection Sortâ OR âBubble Sortâ sorting algorithm. Use sample numbers to illustrate your answer. [20 %]
[55 %]