wingman007

2015_OOP_World4_Static_Program

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