1. This document is an exam for a second year computing course at Machakos University covering event driven programming. It contains 5 questions testing various programming concepts.
2. Question 1 has 6 parts testing understanding of programming terminology, languages, frameworks, machine components, and control structures. It also requires writing a simple arithmetic program.
3. Questions 2-4 require writing simple programs in VB.NET to demonstrate loops, selection statements, arrays, recursion, and exception handling.
4. Question 5 differentiates pseudocode from algorithms and requires recursive and exception handling programs.
1. This document is an exam for a second year computing course at Machakos University covering event driven programming. It contains 5 questions testing various programming concepts.
2. Question 1 has 6 parts testing understanding of programming terminology, languages, frameworks, machine components, and control structures. It also requires writing a simple arithmetic program.
3. Questions 2-4 require writing simple programs in VB.NET to demonstrate loops, selection statements, arrays, recursion, and exception handling.
4. Question 5 differentiates pseudocode from algorithms and requires recursive and exception handling programs.
DEPARTMENT OF COMPUTING AND INFORMATION TECHNOLOGY
SECOND YEAR FIRST SEMESTER EXAMINATION FOR BACHELOR OF SCIENCE
(INFORMATION TECHNOLOGY) SCS 202: EVENT DRIVEN PROGRAMMING DATE: 5/12/2017 TIME: 11.00-1.00 PM INSTRUCTIONS: Answer Question 1 (Compulsory) and any other 2 Questions
QUESTION ONE (30 MARKS)
a) Distinguish between the following terminology. i. Constant and Enumeration (2 marks) ii. Modifier and Directive (2 marks) b) Describe the three major categories of programming languages. (3 marks) c) Outline some of the components of the .Net frameworks. (5 marks) d) Describe the logical units of a personal computing machine. (6 marks) e) Briefly describe the three forms of control needed to implement a program. (6 marks) f) Write a simple program in VB .Net language that performs four arithmetic operations on two operands and displays the answers. (6 marks)
QUESTION TWO (20 MARKS)
a) Briefly explain the difference between the do while, the while and for repetition statements using a relevant example. (5 marks) b) Write simple programs in VB.Net language that demonstrates the following statements.
Examination Irregularity is punishable by expulsion Page 1 of 2
i. The while loop (5 marks) ii. The do while loop (5 marks) iii. The for…next loop (5 marks)
QUESTION THREE (20 MARKS)
a) Explain the selection statements using flow diagrams and their respective syntax. (12 marks) b) Write a program in VB.Net to demonstrate the switch case statement. (8 marks)
QUESTION FOUR (20 MARKS)
a) Differentiate between recursive functions and iterative functions. (4 marks) b) Write a program in VB.Net that initializes an array with 10 elements and displays the elements. (8 marks) c) Write a program in VB.Net that demonstrates the creation of a two-dimensional array and displays the elements. (8 marks)
QUESTION FIVE (20 MARKS)
a) Distinguish between pseudocode and algorithm. (4 marks) b) Write a program in VB.Net that calculates factorial for a given number using a recursive function. (8 marks) c) Write a program in VB.Net that demonstrates the concept of exception handling. (8 marks)
Examination Irregularity is punishable by expulsion Page 2 of 2