예제 #1
0
 public static void Main()
 {
     Chicken chicken = new Chicken("Mara", 3);
     Console.WriteLine(chicken.ProductPerDay);
     chicken.GetHumanAge();
 }
예제 #2
0
        public static void Main()
        {
            Chicken chicken = new Chicken("Mara", 3);

            Console.WriteLine(chicken.ProductPerDay);
        }
예제 #3
0
        static void Main(string[] args)
        {
            var chicken1 = new Chicken("Erna", 12);

            Console.WriteLine($"{chicken1.Name} is {chicken1.Age} years old and poops out {chicken1.EggsPerDay} eggs per day");
        }
예제 #4
0
 static void Main(string[] args)
 {
     try
     {
         string name = Console.ReadLine();
         int age = int.Parse(Console.ReadLine());
         var chicken = new Chicken(name, age);
         Console.WriteLine($"Chicken {chicken.Name} (age {chicken.Age}) can produce {chicken.ProductPerDay()} eggs per day.");
     }
     catch(Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
예제 #5
0
 public static void Main()
 {
     Chicken chicken = new Chicken("Mara", 65);
     Console.WriteLine(chicken.ProductPerDay);
 }