wingman007

2015_OOP_World3_Static_Program

Apr 21st, 2015
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.07 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 World3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("National Income = {0}", Person.CountNationaIncome());
  14.             Console.WriteLine("PI = {0}", Person.PI);
  15.             Console.WriteLine("onlyRead = {0}", Person.onlyRead);
  16.             // int counter = 0;
  17.             Person person1 = new Person("Stoyan", 51);
  18.             // counter++;
  19.             // person1.Name = "Stoyan";
  20.             // person1.Age = 51;
  21.  
  22.             Person person2 = new Person(18, "Tanya");
  23.             // counter++;
  24.             // person2.Name = "Tanya";
  25.             // person2.Age = 18;
  26.  
  27.             Person person3 = new Person();
  28.             // counter++;
  29.  
  30.             person1.IntroduceYourSelf();
  31.             person2.IntroduceYourSelf();
  32.             person3.IntroduceYourSelf();
  33.             // Console.WriteLine("Only read = {0}",person1.onlyRead);
  34.             // Console.WriteLine("Only read = {0}", person2.onlyRead);
  35.             // person1.onlyRead = 45.6;
  36.  
  37.             Person.Nationality = "German";
  38.  
  39.             person1.IntroduceYourSelf();
  40.             person2.IntroduceYourSelf();
  41.             person3.IntroduceYourSelf();
  42.  
  43.             IncreasePopulation();
  44.  
  45.             Console.WriteLine("The population of my kingdom is {0}", Person.Counter);
  46.  
  47.             Console.WriteLine("National Income = {0}", Person.CountNationaIncome());
  48.  
  49.             /*
  50.             Console.WriteLine("My name is {0}. I am {1} years old. My balce is {2}",
  51.                 person1.Name, person1.Age, person1.Balance);
  52.  
  53.             Console.WriteLine("My name is {0}. I am {1} years old",
  54.                 person2.Name, person2.Age);
  55.  
  56.  
  57.             Console.WriteLine("My name is {0}. I am {1} years old",
  58.                 person3.Name, person3.Age);
  59.             */
  60.         }
  61.  
  62.         private static void IncreasePopulation()
  63.         {
  64.             Person petko = new Person("Petko", 18);
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment