Advertisement
wingman007

OOP2018CatDog_Animal

May 10th, 2018
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 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 AnimalTrainer
  8. {
  9.   abstract class Animal : IMakeNose
  10.   {
  11.     public string Name { get; set; }
  12.     public int Age { get; set; }
  13.     public Animal(string name, int age)
  14.     {
  15.       Name = name;
  16.       Age = age;
  17.     }
  18.     public virtual string MakeNoise()
  19.     {
  20.       return String.Format("My name is {0}. I am {1} years old.", Name, Age);
  21.     }
  22.   }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement