Question
Consider six classes i.e. Person, Professor, Researcher, Department, Laboratory, and University having following specifications. Class University has Two attributes of type string i.e. universityName
Consider six classes i.e. Person, Professor, Researcher, Department, Laboratory, and University having following specifications.
Class University has
• Two attributes of type string i.e. universityName and location • An attribute named dept of type Department
Class Department has
•Two attributes i.e. deptID, deptName
• A two-argument constructor to initialize data fields with user-defined values • A member function display() to show all attribute values
Class Laboratory contains
•Two attributes i.e. labID and experimentNo
•A two-argument constructor to initialize data member with user-defined values
Class Person has
•Two attributes i.e. name and age
• A parameterized constructor to initialize attributes with user-defined values • A member function display() to show its attribute values
Class Professor is derived from class Person and has
•A data field named profName of type string
•A data field named dept of type Department
•A two-argument constructor to initialize both attributes of user-defined values
Class Researcher is derived from class Professor and has
•An additional attribute named lab of type Laboratory
•A constructor to initialize lab with user-defined value
a)Draw UML diagram for each class and show inheritance, aggregation, and composition relationship between these classes.
b)Implement all these classes while illustrating the concept of aggregation and composition in terms of ownership and life-cycle.
Step by Step Solution
3.31 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
a UML diagram Inheritance Person and Professor Professor and Researcher Aggre...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