Advertisement
wingman007

C#_OOP_Enum_NestedClass_Generics_Program

May 27th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.66 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 App2b
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("My constant is {0}", Human.PI);
  14.             Console.WriteLine("My onlyRead has value = {0}", Human.onlyRead);
  15.             // int counter = 0;
  16.             Human person1 = new Human("Stoyan", 50, Human.BrainSize.Normal);
  17.             // Console.WriteLine(person1.onlyRead);
  18.             // counter++;
  19.             Human person2 = new Human(20, "Ivan", "Petko", "Nikol");
  20.             // counter++;
  21.             Human person3 = new Human();
  22.             // counter++;
  23.  
  24.             // person1.onlyRead = 3.4;
  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("verbous");
  32.             person2.IntroduceYourSelf();
  33.             Console.WriteLine(person2.GetFriendName(0));
  34.             person3.IntroduceYourSelf();
  35.  
  36.             IncreasePopulation();
  37.  
  38.             Student student1 = new Student("Kircho", 25, 2345);
  39.             Athlete athlete1 = new Athlete("Krisi", 26, "futbol");
  40.  
  41.             student1.IntroduceYourSelf();
  42.             athlete1.IntroduceYourSelf();
  43.  
  44.             // Console.WriteLine((int)Human.BrainSize.small);
  45.             Executor exec1 = new Executor(athlete1);
  46.             exec1.MakeHimSpeak();
  47.  
  48.             Console.WriteLine(Days.Friday);
  49.             Console.WriteLine((int)Days.Friday);
  50.             Console.WriteLine(Days.Friday is Days);
  51.  
  52.             Manager<Student> manager = new Manager<Student>();
  53.             // manager.AddStudent(student1);
  54.             // manager.AddStudent(student1);
  55.             // manager.RemoveStudent();
  56.             manager.AddEntity(student1);
  57.             manager.AddEntity(student1);
  58.             manager.RemoveEntity();
  59.             Console.WriteLine("I am managing {0} entities!", manager.GetNumberOfEntities());
  60.  
  61.             Console.WriteLine("The population {0}", Human.counter);
  62.  
  63.             Console.WriteLine("National Income is {0}", Human.CalculateNationlIncome());
  64.  
  65.             Console.WriteLine("Hello World!");
  66.             Console.Read();
  67.         }
  68.  
  69.         public static void IncreasePopulation()
  70.         {
  71.             Human person1 = new Human("Petko", 15, Human.BrainSize.Large);
  72.         }
  73.  
  74.         public enum Days {
  75.             Monday, Tuesday, Wednesday, Thursday, Friday = 400, Saturday, Sunday
  76.         }
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement