DIT 0404: OBJECT ORIENTED PROGRAMMING Past Paper

W1-2-60-1-6
JOMO KENYATTA UNIVERSITY OF AGRICULTURE AND TECHNOLOGY
UNIVERSITY EXAMINATIONS 2014/2015
STAGE IV SPECIAL/SUPPLEMENTARY EXAMINATION FOR THE DIPLOMA IN INFORMATION TECHNOLOGY
DIT 0404: OBJECT ORIENTED PROGRAMMING
DATE:AUGUST 2014 TIME: 1.5 HOURS
INSTRUCTIONS: Answer question one and any other two questions.

QUESTION ONE (20 MARKS) COMPULSORY

a. Define the following terms and phrases as used in programming.

i. Machine language (2 marks)

ii. Machine language. (2 marks)

iii. Source code. (2 marks)

iv. Object code. (2 marks)

v. Library. (2 marks)

b. i. What does a compiler do? (2 marks)

ii. How is a compiler different from an assembler. (4 marks)

iii. Describe the various steps of the programming process.

i. Specification (1 mark)

ii. Code design. (1 mark)

iii. Coding. (1 mark)
iv. Testing. (1 mark)

QUESTION TWO

a. i. Explain the function of the input operator and the output operator in c++.
(4 marks)

ii. Name any examples of data types used in programming. (4 marks)

b. i. Write a program that calculate the area of a circle. (8 marks)

ii. From your code in i above explain the object files below.

i. cin

ii. Cont

QUESTION THREE

a. i. Define the concept of abstraction and explain one example of where abstraction helps us in every date life. (4 marks)

ii. Write a block of code to compute, store, and then output the volume of a sphere (use the formular volume v of a sphere of radius r is give by v=(4/3) PI r3) (8 marks)

b. Enumerate any eight keyword in c++ programming. (8 marks)

QUESTION FOUR

a. i. Write a simple c++ program that display four line of text including the sum of two numbers. (10 marks)

ii. From the code in (i) above give the expected output when the program is executed. (4 marks)

b. Briefly explain the difference between object oriented programming and structured programming methods. (6 marks)

QUESTION FIVE

a. Write a program that compares two integers and output the largest.
(12 marks)

b. From the code in (a) above give the expected output when the program is executed. (8 marks)

(Visited 1,453 times, 1 visits today)
Share this:

Written by