0% found this document useful (0 votes)
51 views2 pages

CMT 211 Paper 1

Past paper

Uploaded by

1045858
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views2 pages

CMT 211 Paper 1

Past paper

Uploaded by

1045858
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

THE CATHOLIC UNIVERSITY OF EASTERN AFRICA

P.O. Box 62157


A. M. E. C. E. A 00200 Nairobi - KENYA
Telephone: 891601-6
Fax: 254-20-891084
MAIN EXAMINATION E-mail:[email protected]

AUGUST – DECEMBER 2018 TRIMESTER

FACULTY OF SCIENCE

DEPARTMENT OF COMPUTER AND LIBRARY SCIENCE

REGULAR PROGRAMME

CMT 211: OBJECT ORIENTED PROGRAMMING II

Date: DECEMBER 2018 Duration: 2 Hours


INSTRUCTIONS: Answer Question ONE and any other TWO Questions.
Calculators MAY be used in this Examination

Q1. i) Define the following terms; (6 marks)


i) Method overloading
ii) Local Variable:
iii) Instance Variable:

ii) Discuss the role of the following java SDK components (6 marks)
i) Classloader:
ii) Bytecode Verifier:
iii) Security Manager:

iii) Below is a cylindrical tank of radius r and height h. Write a method :

a) vol() that receives the radius r and height h and return the volume

Cuea/ACD/EXM/AUGUST – DECEMBER 2018 / COMPUTER / LIBRARY SCIENCE Page 1

ISO 9001:2008 Certified by the Kenya Bureau of Standards


of the cylinder in liters (3 marks)

b) SurfArea () that receives the radius r and height h and return the
surface area of the cylinder in m square. (3 marks)

iv) Give any five significance of methods/functions in software


developments. ( 5 marks)

v) Give three differences that exist between Java and C++ (3 marks)

vi) Java is a pure object-oriented programming language. Discuss.


( 4 marks)
Q2. a) Refer to the methods you wrote in question 1 (iii) (a) and (b). Write a java
program that uses the methods above to return the surface area and
volumes of 15 cylinders whose radius must be between 160.5 cm and
125.0 cms and height is from 200cm and 160 cm and are all randomly
generated in column form as shown below. 10 marks
Radius Height Volume Surface Area

b) Explain with java example program the use of any five Scanner class
methods (10 marks)

Q3. a) Draw the Flow chart that will generate 50 random integer number between
-13 and 63 and print them only if they are even in columns of 10 .
(10marks)

b) Write the corresponding program (10marks)

Q4. Consider a class Employee that can be used to generate a list of employees in
an organization, employee payslip and sort the employees based on gender ,
number of years worked and retirement date.
i) Explain the possible data members ( 2 marks)
ii) Explain at least 6 get and 6 setter Methods ( 10 marks)
iii) Write a method createEmployee() that returns an array of 20
employees ( 8 marks)

Q5. a) Explain the use of the following keywords as used in java (6 marks )
i) this.
ii) supper.
iii) transient :
iv) Static Nested

b) Discuss any four types of errors that might lead to an exception.(8 marks)

c) Define the term exceptions and explain in details how they are managed
in java. ( 6 marks)

Cuea/ACD/EXM/AUGUST – DECEMBER 2018 / COMPUTER / LIBRARY SCIENCE Page 2

ISO 9001:2008 Certified by the Kenya Bureau of Standards

You might also like