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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 5PE: Using classes, design an online address book to keep track of the names, addresses, phone numbers,...
icon
Related questions
Question

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.

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning