Dit 504: Application Programming Question Paper
Dit 504: Application Programming
Course:Information Technology
Institution: Kca University question papers
Exam Year:2013
INSTRUCTIONS: Answer Any Three Questions
QUESTION ONE
a) Explain five components of the visual basic IDE (5 Marks)
b) Explain the following programming paradigms (8 Marks)
i. Imperative programming
ii. Functional programming
iii. Procedural programming/ structured programming
iv. Event-driven programming
c) Create a program that prompts a user to input a number then displays (7 Marks)
i. Square root of a number
ii. Square of a number
iii. Area of a circle
QUESTION TWO
a) Write a program that prompts the user to enter the marks for students in five subjects i.e Maths, English, Swahili, Physics and biology, your program should then calculate
i. Sum
ii. Average Score
iii. Grade
Hint: the grading system is as following in the table below (10 Marks)
MARK GRADE
>=80 A
>=70 B
>=60 C
>=50 D
<50 FAIL
b) Describe the following types of variables (6 Marks)
i. Local variables
ii. Module level variables
iii. Public variables
c) Differentiate between a fixed and dynamic array and give a sample declaration of each (4 Marks)
QUESTION THREE
a) When naming variables in VB6 , there are rules to be followed. Give any three of these rules (3 Marks)
b) Using For next, write a VB6 program that will display all the multiples of 6 in the range 135 to 236 (4 Marks)
c) Write down the output of the following piece of code (3 Marks)
Dim a As Integer
a=10
Do While a <> 0
Print a
a= a-1
Loop
d) There are three major categories of errors one can make while writing programs. List them and explain the main differences between them (6 Marks)
e) Why is it important to learn programming concepts? (2 Marks)
f) Define the term ‘Variable’ and show how a variable is declared in VB (2 Marks)
QUESTION FOUR
A visual basic form appears as shown below
The program has the following controls:
• The Data Control is linked to a database called “students.mdb” Whose path is”C:\Students.mdb”
• Four textbox controls display information about a particular student. This information is derived from the fields Student ID, Surname, Other Names and Address respectively. These fields are found in the database table named Students Table.
• Four command buttons for navigation through the database records
• A command button to close the form
a) State the value for each of the following properties of the data control
i. Database Name (2 Marks)
ii. Record Source (2 Marks)
b) State the values for the DataField property of the four bound text boxes. (4 Marks)
c) Write the code tha should be tied to the following command buttons to achieve the following
i. Add Records (2 Marks)
ii. Delete Records (2 Marks)
iii. Update the database (2 Marks)
d) State why option buttons are suitable for selecting the gender rather than the check boxes (2 Marks)
e) Write at most two lines of code that would be used to make the data control invisible at runtime (2 Marks)
f) Write the difference between Dynaset-type and Table-type recordset objects (2 Marks)
QUESTION FIVE
a) Explain the difference between Do While…..Loop and Do……Loop While statements (4 Marks)
b) Explain any two controls that can be used to group other controls (4 Marks)
c) Explain the difference between the following pairs of terms
i. Function procedure and a Sub procedure (2 Marks)
ii. Label and Textbox (2 Marks)
iii. Frame and Picture box (2 Marks)
iv. Check box and Option button (2 Marks)
d) With the help of a sample code, explain each of the following commands used in Visual basic; -
i. Me (2 Marks)
ii. Show (2 Marks)
More Question Papers
Exams With Marking Schemes