Advertisement
wingman007

C#_OOP_2a_Program.cs

Apr 15th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.83 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 App2a
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine(Human.PI);
  14.             // int counter = 0;
  15.             Console.WriteLine("onlyRead is {0}", Human.onlyRead);
  16.  
  17.             Human person1 = new Human("Stoayn", 50);
  18.             // counter++;
  19.             Human person2 = new Human(20, "Ivan", "Petko", "Nikola");
  20.             // counter++;
  21.             Human person3 = new Human();
  22.             // counter++;
  23.  
  24.             // person1.onlyRead = 10.1;
  25.  
  26. //            person1.Name ="Stoyan";
  27. //            person1.Age = 50;
  28.  
  29. //            person2.Name = "Ivan";
  30. //            person2.Age = 20;
  31.  
  32. //            Console.WriteLine("My name is {0}. I am {1} years old! My balace is {2}", person1.Name, person1.Age, person1.Balance );
  33. //            Console.WriteLine("My name is {0}. I am {1} years old!", person2.Name, person2.Age);
  34.  
  35.             Human.Nationality = "German";
  36.  
  37.             person1.IntroduceYourSelf("verbous");
  38.             Console.WriteLine("I am person1 my best friend is {0}!", person1.GetFriend(0));
  39.             person2.IntroduceYourSelf();
  40.             Console.WriteLine("I am person2 my best friend is {0}!", person2.GetFriend(0));
  41.             person3.IntroduceYourSelf();
  42.  
  43.             IncreasePopulation();
  44.             IncreasePopulation();
  45.  
  46.             Console.WriteLine("The population is {0}", Human.counter);
  47.  
  48.             Console.WriteLine("The National Income is {0}", Human.CalculateNationalIncome());
  49.  
  50.             Console.WriteLine("Hello World!");
  51.             Console.Read();
  52.         }
  53.  
  54.         public static void IncreasePopulation()
  55.         {
  56.             Human person1 = new Human("Petko", 15);
  57.         }
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement