Question: Hierarchy/Inheritance/Polymorphism 2. Write a snippet of code to declare (.h) and the implement (.cpp) the family of classes in quality control domain, including -base class

Hierarchy/Inheritance/Polymorphism

2. Write a snippet of code to declare (.h) and the implement (.cpp) the family of classes in quality control domain, including

-base class Test

-derived classes RegressionTest, loadTest

The base class should have a virtual boolean method called run which is overridden in the sub-class, where specific logic is placed(//some code). As an exercise, let the method return true/false randomly.

Then in main, declare a pointer to the base class Test and use it to instantiate and run loadTest. Then use the same pointer to instantiate and run a RegressionTest.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!