Advertisement
wingman007

Exercise2bProgram

Mar 21st, 2017
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Excercise2bAnimals
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Cat flufy = new Cat("Flufy", 5);
  14.             Dog rex = new Dog("Rex", 7);
  15.  
  16.             Coach coach = new Coach(flufy);
  17.             coach.MakeItSpeak();
  18.             coach.Entity = rex;
  19.             coach.MakeItSpeak();
  20.  
  21.             Car bmw = new Car();
  22.             coach.Entity = bmw;
  23.             coach.MakeItSpeak();
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement