Create a class named Laboratory containing • Two data fields i.e. name (a string) and location (string) • A no-argument constructor to initialize all data fields with default values “NoName” and “NULL” • A member function named input() • A member function named show() to display the details associated with an instance of this class Derive a class named WetLab from class Laboratory that includes • data members no_of_microscopes and Scientist_name, • respective mutator and accessor functions • overriding function named input() to take input from user in all data members • overriding function named show() to display the details associated with an instance of class WetLab From the Laboratory class, derive a class named DryLab that contains • a data field named no_of_computers and Capacity • Setters and getters • an overriding function named input() • overriding function named show() to display the details associated with an instance of this class Implement these classes and in the main() create instances of each class and test the functionality of overridden member functions with these instances.
Create a class named Laboratory containing
• Two data fields i.e. name (a string) and location (string)
• A no-argument constructor to initialize all data fields with default values “NoName” and
“NULL”
• A member function named input()
• A member function named show() to display the details associated with an instance of this
class
Derive a class named WetLab from class Laboratory that includes
• data members no_of_microscopes and Scientist_name,
• respective mutator and accessor functions
• overriding function named input() to take input from user in all data members
• overriding function named show() to display the details associated with an instance of class
WetLab
From the Laboratory class, derive a class named DryLab that contains
• a data field named no_of_computers and Capacity
• Setters and getters
• an overriding function named input()
• overriding function named show() to display the details associated with an instance of this
class
Implement these classes and in the main() create instances of each class and test the functionality
of overridden member functions with these instances.
Step by step
Solved in 2 steps with 1 images