Get premium membership and access revision papers, questions with answers as well as video lessons.

Object Oriented Programming Techniques(Dbit 113/ Dcis 211) Question Paper

Object Oriented Programming Techniques(Dbit 113/ Dcis 211) 

Course:Computer Information Systems And Business Information Technology

Institution: Kenya Methodist University question papers

Exam Year:2010



TIME : 2 HOURS
INSTRUCTIONS Answer Question ONE and any Other TWO Questions

Question 1
a) Briefly explain what recursion. (2marks)
b) Write function that will return the factorial of a number. (4marks)
c) Write a Java program to convert temperature from degree Celsius to Fahrenheit. (6marks)
d) Define the following terms:
i) Abstract class
ii) Virtual method
iii) Function overloading (6marks)
e) Using a pseudocode write an algorithm that will accept an array of numbers from the keyboard and print them in ascending order. (4marks)
f) Provide a Java statement to declare an in array and initialize its’ elements to 6, 2, 54, 65 and 50 respectively. (2marks)
g) Write a Java program that asks the user to enter the total marks of the student. The program then grades the marks as follows:
0-50 Fail
51-100 Pass (6marks)

Question 2
a) Using appropriate examples, explain the following object oriented concepts.
i) Object
ii) Class
iii) Encapsulation
iv) Abstraction (4marks)
b) Declare a class called bankAccount to include at least two data members and two methods. Using it to show write a program which using a menu can perform the following tasks:
i) perform a deposit
ii) perform a withdrawal
iii) give a bank balance (16marks)

Question 3
a) Define the following terms.
i) Constructor
ii) Static
iii) Protected
iv) Private (4marks)
b) A college has list of test results (1=pass,2=fail) for 20 students. Write a program in java to that analyzes the results and prints “Raise Tuition” if more than 75% of students pass, else print “investigate the course for mediocre performance”. (16marks)

Question 4
a) Differentiate between the following terms.
i) Parameter and argument
ii) Method and operation (4marks)
b) Write a java program with a super class called Polygon. The class should at least have one virtual method. Define another class called Rectangle that inherits from the class polygon. Instantiate an object of class Rectangle. Show how the object instantiated inherits from the super class. (16marks)






More Question Papers


Popular Exams


Mid Term Exams

End Term 1 Exams

End Term 3 Exams

Opener Exams

Full Set Exams



Return to Question Papers