Kaduna Polytechnic Department of Computer Science College of Science and Technology School of Applied Science
Kaduna Polytechnic Department of Computer Science College of Science and Technology School of Applied Science
NDIIA
BY
1
1.
EXAMPLES: (i) Interface (ii) Class EXAMPLES: (i) Interaction (ii) State
machine
Example:
EMPLOYEE
(ii) Multiple inheritance: A subclass derives from more than one super class.
Example:
LION CAT
3
LAND HABITAT
GRAND-FATHER
FATHER
SON
GRAND-FATHER
4
FATHER
CHILD
Habitat
5
LAND
CAR BUS
VEHICLE
(3)
KITCHEN
HOME Color: red
1
Size: big
6
Wash()
Cook()
BATHROOM
Color: blue
1 0…* 0…3
Size: small
MAIL BOX GARAGE
Enter()
Size: small Color: black
Bath()
Color: black Size: medium
Size: medium
Sleep()
Rest()
4)
-manager
(4b) The types of Relationships used above and why I used them;
1. Composition: The bank itself cannot operate without the use of employees
to run the bank and its day to day activities and also the Teller/operation
8
manager/marketers are off no use if there are no customers for the bank and
the customers need this operation workers to manage their affairs in the bank
(so each classes are dependent on each other).
2. Association: There is a relationship between the bank and its employees and
teller/operation manager/marketers with customers.
3. Inheritance: This here indicates that both savings and current are both
subclasses of the class Account.
4. Reflexive Association: This means an instance of employees can be the
manager of another employee instance.
Airline