-
(a)(i)Describe the concept of Object-Oriented Programming (OOP). [5 marks]
(ii)Give a comparison between OOP and Procedural Programming. [4 marks]
(b)Define a suitable Java class that represents the description given in Description 1. (Hint: use suitable attributes and methods with suitable data types.) [10 marks]
(c)Write a Java program that creates an object of the class definition you gave in (b) and displays the attributes of the object and the computation of the area and perimeter of the object. [6 marks]
Description 1: A parallelogram is a quadrilateral in which its opposite sides are parallel and equal, and the opposite angles are equal. One of the ways of representing it is by specifying the two adjacent sides and the angle between them. In this representation, the properties, area and perimeter, of a parallelogram are computed using the following equations:
-
(a)Enumerate the principles of OOP and write short notes on each of them. [8 marks]
(b)Describe the concepts of Class and Object in Java as an OOP language. [7 marks]
-
(a)With the aid of suitable examples of your choice, describe polymorphic method, and how it is implemented in Java. [7 marks]
(b)With the aid of examples, describe the following programming constructs in Java: (i) Expression (ii) Statement [4 marks each]
-
(a)Object-Oriented Programming is considered to be more secure than the procedural approach. Why? [4 marks]
(b)An executable Java program must contain the main method where execution begins. State the definition of the main method. [5 marks]
(c)List the implication of each part of the main method. [6 marks]
-
(a)Write a short note on object modelling. [5 marks]
(b)List at least four (4) selection characteristics/criteria for identifying objects in object-oriented analysis. [10 marks]
-
(a)Write a short note on class diagram. [6 marks]
(b)Describe the following types of relationships between classes: (i) Generalization (ii) Composition (iii) Aggregation [3 marks each]

