Question
Java Main topics: Composition - Aggregation Inheritance Program Specification: You are to design and implement a set of exactly five classes which can be used
Java
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 String representation of the list of its Leader and all its Members.
Driver - A class which must fully test all of the above classes functionality 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started