#include <iostream>
using namespace std;
class Computer{
public:
void run(){
enterKBC();
enterBIOS();
enterSystem();
showLogo();
}
virtual ~Computer(){ }
protected:
virtual void enterKBC() = 0;
virtual void enterBIOS() = 0;
virtual void enterSystem() = 0;
private:
void showLogo(){ cout << " Joe coLtd. " <<endl; }
};
class LinuxComputer : public Computer{
protected:
void enterKBC() override{
cout << "Enter KBC 1.0." <<endl;
}
void enterBIOS() override{
cout << "Enter BIOS 1.0." <<endl;
}
void enterSystem() override{
cout << "Enter Linux System." <<endl;
}
};
class WindowComputer : public Computer{
protected:
void enterKBC() override{
cout << "Enter KBC 1.5." <<endl;
}
void enterBIOS() override{
cout << "Enter BIOS 1.3." <<endl;
}
void enterSystem() override{
cout << "Enter Windows System." <<endl;
}
};
class MacComputer : public Computer{
protected:
void enterKBC() override{
cout << "Enter KBC 2.0." <<endl;
}
void enterBIOS() override{
cout << "Enter BIOS 2.1." <<endl;
}
void enterSystem() override{
cout << "Enter Mac System." <<endl;
}
};
int main()
{
cout << "Hello World!" << endl;
Computer * linuxComputer = new LinuxComputer();
linuxComputer->run();
cout << "-----------------------"<<endl;
Computer * windowComputer = new WindowComputer();
windowComputer->run();
cout << "-----------------------"<<endl;
Computer * macComputer = new MacComputer();
macComputer->run();
cout << "-----------------------"<<endl;
return 0;
}