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

CMT 211 2

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)
18 views2 pages

CMT 211 2

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]

JANUARY – APRIL 2018 TRIMESTER

FACULTY OF SCIENCE

DEPARTMENT OF COMPUTER AND LIBRARY SCIENCE

REGULAR PROGRAMME

CMT 211: OBJECT ORIENTED PROGRAMMING II

Date: APRIL 2018 Duration: 2 Hours


INSTRUCTIONS:
1. Attempt all Questions in Section A and any other two in Section B
2. Points will be given to clear and logical answers.
3. No reading materials are allowed into the exam room.

Q1. a) Java is a Simple high level, robust, secured and object-oriented


programming language. Discuss in details these characteristics of java.
( 10 marks)

b) Discuss the role of design to a systems developer ( 4 marks)

c) Explain any four packages that are shipped with java ( 4marks)

d) Explain with an example program any four Scanner class methods ( 8 marks)

e) List any four exceptions that may be thrown in a java program. ( 4marks)

Q2. a) Write a java program that receives a line of alphanumeric characters from
the command-line as arguments and then determine : (10 marks)
i) Number of alphabets characters.
ii) Number of numerical characters.
iii) Number of white spaces.
iv) Number of words.

Cuea/ACD/EXM/JANUARY – APRIL 2018 / COMPUTER / LIBRARY SCIENCE Page 1

ISO 9001:2008 Certified by the Kenya Bureau of Standards


v) Number of bytes in the string

b) i) Draw the Flow chart that will will generate 88 random integer number
between 1 and 67 and print them only if they are odd in columns of 8 .
( 5marks)
ii) Write the corresponding program . ( 5marks)

Q3. a) Give five differences that exist between Java and C++ ( 5 marks)

b) Compare and contrast between an interface and an abstract class.


(5marks)

c) Assume a class Employee . Explain any five setter and any five getter
methods that may apply for the class. ( 10 marks)

Q4. a) Discuss the role Java JVM ,JRE and JDK . ( 6marks)

b) Write a java program that would return the maximum of any set of integer
numbers. ( 8marks)

c) Explain the use of the following keywords as used in java (6 marks )


a) this.
b) supper
c) transient
d) Static Nested

Q5. a) Discuss any four types of errors that might lead to an exception.
(8 marks)
b) Define the terms (2 marks)

i) regular expression:
ii) transient: (2 marks)

iii) Object serialization. (2 marks)

b) You are given the string line pattern below. Write down the patterns that can be used to trace
i. The names, (2marks)
ii. Cat1 marks ( 2marks)
iii. Cat2 Marks ( 1marks)
iv. Exam Marks ( 1marks)
String rec = "Joseph Owino: Cat1 06,Cat2 12 and Exam 41";
*END*
Cuea/ACD/EXM/JANUARY – APRIL 2018 / COMPUTER / LIBRARY SCIENCE Page 2

ISO 9001:2008 Certified by the Kenya Bureau of Standards

You might also like