wingman007

2015_OOP_Static_Program

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