wingman007

C#_OOP_Features_Athelete

Jun 5th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 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 App1b
  8. {
  9.     class Athelete : Human
  10.     {
  11.         private string sport;
  12.  
  13.         public string Sport
  14.         {
  15.             get { return sport; }
  16.             set { sport = value; }
  17.         }
  18.  
  19.         public Athelete(string name, int age, string sport)
  20.             : base(name, age, Human.BrainSize.Normal)
  21.         {
  22.             this.sport = sport;
  23.         }
  24.  
  25.         public void ShowSport()
  26.         {
  27.             Console.WriteLine("My sport is {0}", Sport);
  28.         }
  29.  
  30.         public override void IntroduceYourSelf()
  31.         {
  32.             base.IntroduceYourSelf();
  33.             Console.WriteLine("I am an Athlete. My sport is {0}", sport);
  34.         }
  35.     }
  36. }
Add Comment
Please, Sign In to add comment