Exam Questions for Computer Science Course: Electronic Engineering and VB Programming, Exams of Computer Programming

This document consists of exam questions for a bachelor of engineering in electronic engineering course, specifically for the computer applications & programming module. The questions cover various topics including basic programming, vb controls, program development stages, and networking. Students are required to answer any five questions, each carrying equal marks. The document also includes instructions for examiners and examples for some questions.

Typology: Exams

2012/2013

Uploaded on 03/30/2013

lalitchndra
lalitchndra 🇮🇳

4.5

(12)

146 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Cork Institute of Technology
Page 1 of 4
Bachelor of Engineering in Electronic Engineering – Stage 2
(EELXE_7_Y2)
Summer 2008
Computer Applications & Programming
(Time: 3 Hours)
Answer ANY five questions.
All questions carry equal marks.
Examiners: Mr. D. O’Donovan
Mr. D. Denieffe
Dr. P. O’Sullivan
1. Write a main procedure in BASIC to implement the functionality discussed in (a) to (c) and a
separate function to implement (d):
(a) Generate 100 random integer numbers between 56 and 83 inclusive and store the numbers in
a 2-D array consisting of 10 rows and 10 columns. [5 %]
(b) Calculate the average of each row of the array in (a) and store the results in an appropriate
array called ‘results’. [5 %]
(c) Write the contents of the array in (a) above to a file called “testdata.dat” in the root directory
of the D drive. [5 %]
(d) Write a function to calculate the average (called ‘ArrayAverage’) of the results array in (b).
The array and its size should be passed as arguments to the function. The average result
should be passed back to the calling routine such that the function ‘ArrayAverage’ may be
used in the following manner:
average = ArrayAverage(results) [5 %]
pf3
pf4

Partial preview of the text

Download Exam Questions for Computer Science Course: Electronic Engineering and VB Programming and more Exams Computer Programming in PDF only on Docsity!

Cork Institute of Technology

Bachelor of Engineering in Electronic Engineering – Stage 2

(EELXE_7_Y2)

Summer 2008

Computer Applications & Programming

(Time: 3 Hours)

Answer ANY five questions. All questions carry equal marks.

Examiners: Mr. D. O’Donovan Mr. D. Denieffe Dr. P. O’Sullivan

  1. Write a main procedure in BASIC to implement the functionality discussed in (a) to (c) and a separate function to implement (d):

(a) Generate 100 random integer numbers between 56 and 83 inclusive and store the numbers in a 2-D array consisting of 10 rows and 10 columns. [5 %]

(b) Calculate the average of each row of the array in (a) and store the results in an appropriate array called ‘results’. [5 %]

(c) Write the contents of the array in (a) above to a file called “testdata.dat” in the root directory of the D drive. [5 %]

(d) Write a function to calculate the average (called ‘ArrayAverage’) of the results array in (b). The array and its size should be passed as arguments to the function. The average result should be passed back to the calling routine such that the function ‘ArrayAverage’ may be used in the following manner: average = ArrayAverage(results) [5 %]

  1. (a) Explain each of the following terms as they apply in VB:

Control [2 %] Menu Editor [2 %] (b)Write a program to: i. Update the system time (use the TIME$ function) at the top-left corner of a program form after the period selected via the menu option. The menu offers 3 possible time intervals 30, 60 and 90 seconds respectively (see Figure 2.1). State as timer interval settings used. [7 %] ii. The location of any mouse-clicks should be written to a listbox as a string consisting of x-coordinate/y-coordinate. [4 %] iii. Every second mouse-click should increment a counter called ‘update’ located in the top- right of the program form in (b) i. [5 %]

Figure 2.

  1. (a) In the context of networking, discuss the following terms: o Protocol [2%] o WAN & LAN [2%] o Peer to Peer Architecture [2%] o Bus LAN [2%] o Internet Address [2%]

(b) In the context of connecting to the Internet, where might the following technologies be employed? o Satellite [2%] o Wireless [3%] o ADSL [3%] o Fiber-Optics [2%]

  1. (a) A file holds pairs of input and output voltage readings from a test of a circuit. The file is called “C:\Voltages.txt” and will hold a maximum of 100 pairs. Define a user-defined data type to hold one pair of information and an array to hold the full contents of the file. [4 %]

(b) Write a function/subroutine, which reads the file contents into this array. [8 %]

(c) Write a function/subroutine, which takes an input voltage value, finds the matching element in the array and returns the correct output value. [8 %]