Create a class Department with attributes DName, DID, a dynamic listDTeachers of type string.Write accessors and mutators for all data membersand show function to show all data members.Create nullaryand parameterized constructors to initialize the data members.Also write a copy constructor for Department class.In main() create a dynamic array of departments, Use loop to create four objects in the dynamic array. All the even indexed objects should be created with nullary constructors and thencall the accessors and mutators to initializethe objects while, all the odd indexed objects should be initialized using parameterized constructors. Create four copy objects from array using copy constructors.Call the show function to show the four objects.
Create a class Department with attributes DName, DID, a dynamic listDTeachers of type string.Write accessors and mutators for all data membersand show function to show all data members.Create nullaryand parameterized constructors to initialize the data members.Also write a copy constructor for Department class.In main() create a dynamic array of departments, Use loop to create four objects in the dynamic array. All the even indexed objects should be created with nullary constructors and thencall the accessors and mutators to initializethe objects while, all the odd indexed objects should be initialized using parameterized constructors. Create four copy objects from array using copy constructors.Call the show function to show the four objects.
Step by step
Solved in 3 steps with 1 images