Question: Main topics: Composition - Aggregation Inheritance Program Specification : You are to design and implement a set of exactly five classes which can be used
Main topics: Composition - Aggregation Inheritance
Program Specification: You are to design and implement a set of exactly five classes which can be used to model the most basic feature of an orginization.
Person - has only a name.
Member - extends Person to include a unique id.
Leader - extends Member to include what term of a 2 year term of office they are in.
Org:
A Person can only be the Leader of a single Org.
A Person can be a Member of multiple Orgs.
An Org has a name.
An Org has a single Leader.
An Org may have many Members.
An Org can generate a rouster of its Leader and all its Members.
Driver - A class which must fully test all of the above classes functionallity by minimally constructing two unique Orgs - with unique Leaders, and multiple Members - at least one of which is a Member of multiple Orgs.
Rules and Requirements:
When designing your classes you must use Inheritance, Composition and Aggregation correctly to Enforce the defining characteristics above.
For each class (other than Driver):
An appropriate default and specifying constructor must be included. In derived classes, the corresponding super constructor must be utilized.
All access of instance variables (within each class), by the other instance methods must be made via the classes accessor(s) and/or mutator(s).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
