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

Comp 326: Object Oriented Programming With Java December 2010  Question Paper

Comp 326: Object Oriented Programming With Java December 2010  

Course:Bachelor Of Computer Science

Institution: Kabarak University question papers

Exam Year:2010



KABARAK UNIVERSITY
UNIVERSITY EXAMINATIONS
2010/2011 ACADEMIC YEAR
FOR THE DEGREE OF BACHELOR OF COMPUTER SCIENCE

COURSE CODE: COMP 326
INSTRUCTIONS:
1. Section A is compulsory and has 30 marks.
2. Attempt any TWO questions from Section B. Each question has 20 marks.

SECTION A
QUESTION 1 (30 MARKS)
a) As a programmer at KenGen write a java program to find the simple interest.
(5 marks)
b) Explain any five object-oriented programming concepts. (5 marks)
c) What is a class access modifier? Explain the three major class access modifiers used
in java programming language. (5 marks)
d) (5 marks)
e) Java provides many different packages; explain any five different java packages.
(5 marks)
f) You have been employed as a junior java programmer at Kabarak University.
Highlight the five primary goals in the creation of the Java programming language.
(5 marks)

SECTION B
QUESTION 2 (20 MARKS)
a) When naming variables, several rules should be considered. Briefly explain any four
of such rules. (4 marks)
b) Java has classes that can be used to handle exceptions in various situations. Explain
any four different types of classes used handle exceptions. (4 marks)
c) What is a string? Explain the process of declaring and printing a string using a java
code. (4 marks)
d) Briefly explain the process of creating variables for a class. (4 marks)
e) Write a java program to find the prime numbers between 1 and 20. (4 marks)

QUESTION 3 (20 MARKS)
a) Explain with the help of a java code on how the ternary operator is used. (4 marks)
b) Frames are used for displaying several graphical components. Explain any four frame
class methods used in java. (4 marks)
c) What is an array? Explain the process of accessing the array elements in any java
program. (4 marks)
d) Explain the difference between accessor and mutator methods in java. (4 marks)
e) Being a software developer write a java program to find the sum of the elements of a
2x2 matrix. (4 marks)

QUESTION 4 (20 MARKS)
a) Having worked with more than one programming languages, what are the importance
of java that makes it stand out than other programming languages. (4 marks)
b) What is an applet? Briefly explain the java applet class. (4 marks)
c) Briefly explain the History of java programming language. (4 marks)
d) There are several types of events that can happen in a Java program. Explain any four
of the different types of events. (4 marks)
e) Write a java program to swap two numbers. (4 marks)

QUESTION 5 (20 MARKS)
a) Explain in details why java language is said to be platform independent. (4 marks)
b) Loops make programming an adventure for beginners; briefly explain the process of
breaking out of a loop and continuing a loop. (4 marks)
c) Java provides many different types of interfaces for a wide variety of functionality.
Explain any two different types of these interfaces. (4 marks)
d) Exceptions are handled by executing a specific set of code if there is an error. Briefly
explain the process of exception handling in java. (4 marks)
e) Write a java program to find the average of any give three numbers. (4 marks)






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