Activate Timer - Interface Programming - Exam, Exams of Computer Programming

Main points of this exam paper are: Activate Timer, Console-Based, Visual Basic, Programming Project, Random Number, Integer Numbers, Calling Function

Typology: Exams

2012/2013

Uploaded on 03/31/2013

parameshwari
parameshwari 🇮🇳

4.3

(7)

91 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CORK INSTITUTE OF TECHNOLOGY
INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ
Semester 1 Repeat Examinations 2011
Module Title: Interface Programming 590 CA
Module Code: COMP6025
School: Electrical and Electronic Engineering
Programme Title: Bachelor of Engineering in Electronic Engineering
Programme Code: ELES_L8_Y2
External Examiner(s): Dr. A. Donnellan, Mr. I. Kennedy
Internal Examiner(s): Donal O’Donovan
Time: 2 hours
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: 70 %]
Instructions:
(a) Each program should be stored in a separate project folder. (Select the ‘Create
new folder’ option when creating the project.)
(b) Save all projects on the desktop.
(c) The project name should be formatted as follows:
o name question number, e.g., John_Smith_Q1
(d) 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.
(e) 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: 30 %]
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.
pf3
pf4
pf5

Partial preview of the text

Download Activate Timer - Interface Programming - Exam and more Exams Computer Programming in PDF only on Docsity!

CORK INSTITUTE OF TECHNOLOGY

INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ

Semester 1 Repeat Examinations 2011

Module Title: Interface Programming 590 CA

Module Code: COMP

School: Electrical and Electronic Engineering

Programme Title: Bachelor of Engineering in Electronic Engineering

Programme Code: ELES_L8_Y

External Examiner(s): Dr. A. Donnellan, Mr. I. Kennedy Internal Examiner(s): Donal O’Donovan

Time: 2 hours

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: 70 %]

Instructions: (a) Each program should be stored in a separate project folder. (Select the ‘Create new folder’ option when creating the project.) (b) Save all projects on the desktop. (c) The project name should be formatted as follows: o ‘name question number’, e.g., John_Smith_Q (d) 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. (e) 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: 30 %] 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.

Practical Section - Console:

1. Write a console-based Visual Basic.NET programming project to perform the following:

i. Generate a random number between 100 and 1000 called FILE_SIZE. [3 %]

ii. Write a sub-procedure to: (a) Generate FILE_SIZE random integer numbers between 150 and

  1. [4 %]

(b) Return the random numbers to the calling function, i.e. , main(), in an array of size FILE_SIZE and stored (in main()) in an integer array called dataArray. [3 %]

(c) The numbers should be written to a file, called ‘c:\myfolder\datafile.dat’. Each random number should be stored on a separate line. [7 %]

iii. Write a function, called RollingAverage, to calculate the average of five integer values passed by value as an array to the function. The ‘rolling’ average result should be returned as the result of the function call.

i.e. ,^0 1 2 3 5

array array array array array RollingAverage     (^)  [5 %]

iv. Define a structure, called RollingStruct, consisting of: [4 %]

o A rolling-average array, called RollingArray, which stores five integer elements (used in the calculation the rolling average in (iv)).

o A single-precision floating-point number used to store the corresponding rolling average value, called rollingAvg.

v. In main(), define an array of RollingStruct structures (see iv.), called structArray, of size FILE_SIZE – 4 and redim the RollingArray field of each structure to a size of 5 elements. [4 %]

vi. In main(), write code to populate the rolling-average array RollingArray in each RollingStruct structure of the array of structures structArray in (v) with integer data values from dataArray in (ii (b)).

iii. Display the currently-selected ListData item in the Display Label. [3 %]

iv. If the checkbox ‘Double speed’ is ticked, the timer speed should double. [4 %]

v. The scroll bar tab position should increase by one, resetting when the maximum position is reached. [4 %]

(c) Add a menu bar to your application with one menu called ‘File’ and insert an option to ‘Quit’ the program into the File submenu. [2 %]

[26 %]

(Continued Over)

Theory Section:

In an examination booklet, answer the following:

  1. (a) Explain the concept of ‘function overloading’ and demonstrate its use using a simple example. [6 %]

(b) Explain the difference passing arguments to a function using the ‘byRef’ and ‘byVal’ options. [4 %]

(c) Demonstrate, using diagrams, how recursion may be used to generate Fibonacci series FnFn (^)  1  Fn  2 with seed values F 0 (^)  0 and F 1 (^)  1. Write code to implement the Fibonacci series. [10 %]

(d) Using diagrams to illustrate your answer, give a detailed explanation of the operation of the ‘Selection Sort’ sorting algorithm. [10 %]

[30 %]