#include <iostream>using namespace std;class makeDrink{public: virtual void step1() = 0; virtual void step2() = 0; virtual void step3() = 0; virtual void step4() = 0; void make(){ step1(); step2(); step3(); step4(); }};class makeCoffee: public makeDrink{public: void step1(){ cout << "boil water" << endl; } void step2(){ cout << "put in couple" << endl; } void step3(){ cout << "boil coffee" << endl; } void step4(){ cout << "put some milk" << endl; }};class makeTea: public makeDrink{public: void step1(){ cout << "boil water" << endl; } void step2(){ cout << "put in couple" << endl; } void step3(){ cout << "boil tea" << endl; } void step4(){ cout << "put something" << endl; }};void doWork(makeDrink& domake){ domake.make();}int main(){ makeTea tea; makeCoffee coffee; doWork(tea); doWork(coffee); system("pause"); return 0;}