DIT 0404: ADVANCED OBJECT ORIENTED PROGRAMMING Past Paper

W1-2-60-1-6
JOMO KENYATTA UNIVERSITY OF AGRICULTURE AND TECHNOLOGY
University Examinations 2015/2016
YEAR II SEMESTER II EXAMINATION FOR THE DIPLOMA IN INFORMATION TECHNOLOGY

DIT 0404: ADVANCED OBJECT ORIENTED PROGRAMMING

DATE: AUGUST, 2016 TIME: 1.5 HOURS

INSTRUCTIONS: Answer Question ONE and Any Other TWO Questions.

Question One (30 Marks)

a) Define the following OOP terms. [6 marks]

i. Object oriented programming
ii. Objects
iii. Class

b) State any four advantages of OOP. [4 marks]

c) What are the features required of an object oriented programming language. [4 marks]

d) Explain any four applications of OOP. [6 marks]

e) With the aid of an example explain the term constant as used in OOP. [4 marks]

f) With the aid of an example explain the parts of a java method. [6 marks]

Question Two (15 Marks)

a) With the aid of an example distinguish between the Do and the Do….while looping control structures. [4 marks]

b) Explain the output of the following java code. [2 marks]

public class test {
public static void main (string args [ ]){
for (intx=10;x<20;x=x+1)
}
}

c) With examples, explain the following: [9 marks]

i. Class variables
ii. Instances variables
iii. Local variables

Question Three (15 Marks)

a) Explain the requirement of the following mathematical expressions in Java. [3 marks]

i. x++
ii. x- –
iii. x+=y

b) Explain what is meant by object oriented concept of: [12 marks]

i. Inheritance
ii. Abstraction
iii. Polymorphism
iv. Encapsulation

Question Four (15 Marks)

a) What are comments used for in programming? In your answer include the two types of comments used in java. [3 marks]

b) With the aid of java code, explain the difference between an if and an if….else statement. [6 marks]

c) Write a java program that would compare integers x and y and return the largest. [4 marks]

Question Five (15 Marks)

a) Explain any five primitive data types supported by java. [10 marks]

b) Explain the three characteristics of an object. [5 marks]

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

Written by