Advertisement
Guest User

Untitled

a guest
May 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Scene {
  5. private:
  6. public:
  7. virtual void update() = 0;
  8. virtual void draw() = 0;
  9. virtual void start() = 0;
  10. };
  11.  
  12. class Ben10 {
  13. private:
  14. public:
  15. virtual void Shout() { cout << "Mere Mortal" << endl; }
  16. };
  17.  
  18. class Heatblast : public Ben10 {
  19. private:
  20. public:
  21. void Shout() { cout << "I'm super hot" << endl; }
  22. void shootLaser() { cout << "Laser" << endl; }
  23. };
  24.  
  25. class Wildmutt : public Ben10 {
  26. private:
  27. public:
  28. void Shout() { cout << "I walk on 4 legs" << endl; }
  29. };
  30.  
  31. class FourArms : public Ben10 {
  32. private:
  33. public:
  34. void Shout() { cout << "I have Four Arms" << endl; }
  35. };
  36.  
  37. int main() {
  38.  
  39. Ben10* arr[5];
  40. arr[0] = new Heatblast();
  41. arr[1] = new Wildmutt();
  42. arr[2] = new FourArms();
  43. arr[3] = new Ben10();
  44.  
  45. /*arr[0].Shout();
  46. arr[1].Shout();
  47. arr[2].Shout();
  48. arr[3].Shout();*/
  49.  
  50. arr[0]->Shout();
  51. arr[1]->Shout();
  52. arr[2]->Shout();
  53. arr[3]->Shout();
  54.  
  55. return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement