Advertisement
wingman007

C#_OOP_1b_Inheritance_Program.cs

Apr 24th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.16 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 App1a
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine(Human.PI);
  14.             Console.WriteLine(Human.onlyRead);
  15.             // int counter = 0;
  16.             Human person1 = new Human("Stoyan", 50);
  17.             // Console.WriteLine(person1.onlyRead);
  18.            
  19.             // counter++;
  20.             Human person2 = new Human(20, "Ivan", "Petko", "Nikola");
  21.             // counter++;
  22.             Human person3 = new Human();
  23.             // counter++;
  24.  
  25.             Human.Nationality = "German";
  26.  
  27. //            Console.WriteLine("My anme is {0}. I am {1} years old!", person1.Name, person1.Age);
  28. //            Console.WriteLine("My anme is {0}. I am {1} years old!", person2.Name, person2.Age);
  29.             // string verbous = "verbous";
  30.             person1.IntroduceYourself("dumm");
  31.             person2.IntroduceYourself();
  32.             Console.WriteLine("My friend is {0}", person2.GetFriend(0));
  33.             person3.IntroduceYourself();
  34.  
  35.             IncreasePopulation();
  36.             IncreasePopulation();
  37.  
  38.             Student student1 = new Student();
  39.             student1.FNumber = 123;
  40.             Console.WriteLine("=======Student ========");
  41.             student1.ShowFNumber();
  42.             student1.IntroduceYourself();
  43.             Console.WriteLine("===============");
  44.  
  45.             Athlete athlete1 = new Athlete();
  46.             athlete1.IntroduceYourself();
  47.  
  48.             Console.WriteLine("========== Student =========");
  49.             student1.IntroduceYourself();
  50.  
  51.             Executor exec1 = new Executor(student1);
  52.             exec1.MakeHimSpeak();
  53.  
  54.             Console.WriteLine("The population is {0}", Human.counter);
  55.  
  56.             Console.WriteLine("National Income {0}", Human.CalculateNationalIncome());
  57.  
  58.             Console.WriteLine("Hello World!");
  59.             Console.Read();
  60.         }
  61.  
  62.         public static void IncreasePopulation()
  63.         {
  64.             Human person1 = new Human("Peshko", 15);
  65.             //counter++;
  66.         }
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement