Question: PART 1 do it in c++ A. Factory design method Make a base class shapes and derived class circle, rectangle, square Implement the factory design
PART 1
do it in c++
A. Factory design method
Make a base class shapes and derived class circle, rectangle, square
Implement the factory design pattern for this question.
B. Abstract class/Pure virtual function
Car:: before drive, car should be test properly
Create a base class Car thar have virtual function engine, breaks, tyre now
class Car{
public:
virtual void engine ()=0;
virtual void breaks ()=0;
virtual void tyre ()=0;
};
bool testingCar(Car *a){
a->engine();//polymorphic call
a->breaks ();
a->tyre();
return true;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
