Advertisement
wingman007

OOP_2015_4Principles_Program

Mar 20th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.72 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 Person1a
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             // int i = 0;
  14.             Person person1 = new Person("Stoyan", 50);
  15.             // i++;
  16.             Person person2 = new Person();
  17.             // i++;
  18.             Person person3 = new Person(20, "Rayna");
  19.             // i++;
  20.  
  21.             // person1.Name = "Stoyan";
  22.             // person1.Age = 50;
  23.  
  24.             // person2.Name = "Rayna";
  25.             // person2.Age = 20;
  26.             /*
  27.             Console.WriteLine("My name is {0}. I am {1} old.",
  28.                 person1.Name, person1.Age);
  29.  
  30.             Console.WriteLine("My name is {0}. I am {1} old.",
  31.                 person2.Name, person2.Age);
  32.  
  33.             Console.WriteLine("My name is {0}. I am {1} old.",
  34.                 person3.Name, person3.Age);
  35.             */
  36.  
  37.             Person.nationality = "German";
  38.  
  39.             person1.IntroduceYourSelf();
  40.             person2.IntroduceYourSelf();
  41.             person3.IntroduceYourSelf();
  42.  
  43.             System.Console.WriteLine(Person.counter);
  44.  
  45.             Person student1 = new Student("Mariya", 20, 43241);
  46.             // student1.FNumber = 12345;
  47.  
  48.             student1.IntroduceYourSelf();
  49.  
  50.             Person athlete1 = new Athlete("Kircho", 25, "box");
  51.  
  52.             athlete1.IntroduceYourSelf();
  53.  
  54.             Console.WriteLine(athlete1);
  55.  
  56.             Executor exec1 = new Executor(student1);
  57.             exec1.MakeHimSpeak();
  58.             exec1.Entity = athlete1;
  59.             exec1.MakeHimSpeak();
  60.  
  61.             Console.WriteLine("Hello World");
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement