Você está na página 1de 4

PROGRAMMING STAGE TWO EXAMINATION TI ME:3 HOURS 2010

KABETE TECHNICAL TRAINING INSTITUTE


DIPLOMA IN COMPUTER STUDIES CLASS DCS 2009

PROGRAMMING SUPLIMENTARY 3 HOURS

INSTRUCTIONS TO CANDIDATES Answer any five of the following eight questions. All questions carry equal marks

1. (a) Explain the following terms as applied in visual basic. i. Event driven programming ii. Integrated development environment iii. Intrinsic controls iv. Data objects (8 Marks) (b) State FOUR that can be followed when designing a visual basic program. (4 Marks) (c) Describe FOUR merits of visual programming over structured. (8 Marks) 2. (a) Explain the use of each of the following. i. Combo box ii. List box iii. Picturebox (3 Marks) (b) List FOUR data type in visual basic, giving their respective storage in bytes. (4 Marks) (c) Explain the following declarations. i. Dim dynar() As integer ii. Redim dynar(10) (4 Marks) (d) A lecturer at Kabete requires to compute the average mark for each student in a class of 20 students. Each student has taken four exams during course of the semester. Write a visual program to calculate the average mark for each student. (9 Marks) 3. (a) Write a visual program to print the following pattern on the form. # ## ### #### ##### ###### ####### (4 Marks) (b) Explain the following terms with respect to visual languages. i. Properties ii. Methods iii. Events (6 Marks) (c) Table below shows details of the examination grading system in kimbo technical training institute.

MARKS 80-100 60-79 40-59 0-39

GRADE 1 2 3 4

REMARK Distinction Credit Pass Fail

Write a visual basic program using select case statement that will allow a students marks to be input and graded accordingly. Attach the program to a command click event . Assume the marks are input in a textbox called txtmarks. (10 Marks) 4. (a) Distinguish between logical operators and mathematical operators giving an example in each case. (4 Marks) (b) Evaluate the dividend in the following visual basic program segment. x=5 , y= 4 , z= 15 dividend= (x+y*z/x) /y (4 Marks) (c) distinguish between logical errors and syntax errors giving an example in each case (4 Marks) (d) Using visual basic, write a user-defined data type called student containing the following fields. (8 Marks) 5. (a) Distinguish the following form events load and show. (4 Marks) (b) State the function of the following. i. Linker ii. Interpreter iii. Debugger (6 Marks) (c) Distinguish between modal and non-modal dialog boxes. (4 Marks) (d) Explain the usage of the following in visual basic. i Project explorer window ii variant data type iii module window (6 Marks) 6. (a) Distinguish between public and private declaration in a procedure. (4 Marks) (b) Distinguish between pass by value and pass by reference. ( 4 Marks)

(c) Write a visual basic program that calculates the area of a circle using a user defined procedure. (12 Marks) 7. (a) State TWO search techniques used in programming languages. (2 Marks) (b) State FOUR inbuilt functions that can be used to manipulate strings. (4 Marks) (c) Sketch the windows generated when each of the following visual basic functions are executed. (6 Marks) (d) Explain FOUR merits of using sub-programs. (8 Marks) 8. (a) Differentiate between sequential and random access files as applied in visual basic. (4 Marks) (b) interpret the following program code. blitemFound=false intitemindex=0 do until blitemFound or intitemindex = lstitems.listcount if txtNewItem.text= lstItems.list(intItemIndex) then bItemFound=true intitemindex = intitemindex +1 loop (6 Marks) (c) For effective management, the Board of Goveners at Migori polytechnic resolved to purchase a computerized system. Their accounts department had a manual file with the following details. AdminNo 1428 1429 1430 FeeBalance 10,000 5,000 12,000 Age 20 25 17

i. Write a visual basic program to create a sequential file called student.dat file ii. Write a visual basic program that will output the contents of the file created in 8(c)(i) above. (10 Marks)

Você também pode gostar