wingman007

2015_OOP_2gr_Program

Apr 27th, 2015
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.31 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 World2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("The value of PI is {0}", Person.PI);
  14.             Console.WriteLine("onlyRead = {0}", Person.onlyRead);
  15.             // int counter = 0;
  16.             Person person1 = new Person("Stoyan", 51);
  17.             // counter++;
  18.             // person1.Name = "Stoyan";
  19.             // person1.Age = 51;
  20.  
  21.             Person person2 = new Person(18, "Maria");
  22.             // counter++;
  23.             // person2.Name = "Maria";
  24.             // person2.Age = 18;
  25.  
  26.             Person person3 = new Person();
  27.             // counter++;
  28.  
  29.             person1.IntroduceYourSelf();
  30.             person2.IntroduceYourSelf();
  31.             person3.IntroduceYourSelf();
  32.             Console.WriteLine("Only read for person1 {0}", Person.onlyRead);
  33.             Console.WriteLine("Only read for person2 {0}", Person.onlyRead);
  34.  
  35.             Person.Nationality = "German";
  36.  
  37.             person1.IntroduceYourSelf();
  38.             person2.IntroduceYourSelf();
  39.             person3.IntroduceYourSelf();
  40.  
  41.             IncreasePopulation();
  42.  
  43.             Console.WriteLine("The national income is {0}", Person.CalculateNationalIncome());
  44.  
  45.             Console.WriteLine("The population is {0}", Person.Counter);
  46.  
  47.             Person student1 = new Student("Kircho", 25, "1234123231"); //
  48.             student1.IntroduceYourSelf();
  49.  
  50.             Student student2 = new Student();
  51.  
  52.             Athlete athlete1 = new Athlete("Krisi", 25, "box");
  53.             Console.WriteLine(athlete1);
  54.  
  55.             Executor exec = new Executor(student1);
  56.             exec.MakeHimSpeak();
  57.  
  58.  
  59. //            Console.WriteLine("My name is {0}. I am {1} years old! My balance is {2}",
  60. //                person1.Name, person1.Age, person1.Balance);
  61. //            Console.WriteLine("My name is {0}. I am {1} years old!",
  62. //                person2.Name, person2.Age);
  63. //            Console.WriteLine("My name is {0}. I am {1} years old!",
  64. //                person3.Name, person3.Age);
  65.         }
  66.  
  67.         private static void IncreasePopulation()
  68.         {
  69.             Person petko = new Person("Petko", 18);
  70.         }
  71.  
  72.     }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment