Advertisement
wingman007

C#_OOP_1b_Program.cs

Apr 17th, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.92 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 App1b
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine(Human.PI);
  14.             // int counter = 0;
  15.            
  16.             Human person1 = new Human("Stoyan", 50);
  17.             Console.WriteLine("Only for read = {0}", Human.onlyRead);
  18.             // counter++;
  19.  
  20.             Human person2 = new Human(20, "Ivan", "Petko", "Niki");
  21.             // counter++;
  22.  
  23.             Human person3 = new Human();
  24.             // counter++;
  25.  
  26.             // Console.WriteLine("My name is {0}. I am {1} years old", person1.Name, person1.Age);
  27.             // Console.WriteLine("My name is {0}. I am {1} years old", person2.Name, person2.Age);
  28.  
  29.             Human.Nationality = "German";
  30.  
  31.             person1.IntroduceYourSelf("dummy");
  32.             person2.IntroduceYourSelf();
  33.             Console.WriteLine("And my best friend is {0}", person2.GetFriend(0));
  34.             person3.IntroduceYourSelf();
  35.  
  36.             IncreasePopulation();
  37.             IncreasePopulation();
  38.  
  39.             Console.WriteLine("My population is {0}", Human.counter);
  40.  
  41.             Console.WriteLine("The National Income is {0}", Human.CalculateNationalIncome());
  42.  
  43.             Console.WriteLine("Hello World!");
  44.             /*
  45.             string input = Console.ReadLine();
  46.             Console.WriteLine(input);
  47.             try
  48.             {
  49.                 int validated = Int16.Parse(input);
  50.                 Console.WriteLine("Sled parsing chisloto e {0}", validated);
  51.             }
  52.             catch (Exception e)
  53.             {
  54.                 Console.WriteLine("Error");
  55.             }
  56.            */
  57.             Console.Read();
  58.         }
  59.  
  60.         public static void IncreasePopulation()
  61.         {
  62.             Human person1 = new Human("Pesho", 15);
  63.         }
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement