CMT 211 Paper 1
CMT 211 Paper 1
FACULTY OF SCIENCE
REGULAR PROGRAMME
ii) Discuss the role of the following java SDK components (6 marks)
i) Classloader:
ii) Bytecode Verifier:
iii) Security Manager:
a) vol() that receives the radius r and height h and return the volume
b) SurfArea () that receives the radius r and height h and return the
surface area of the cylinder in m square. (3 marks)
v) Give three differences that exist between Java and C++ (3 marks)
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)
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)