public static void Main() { Chicken chicken = new Chicken("Mara", 3); Console.WriteLine(chicken.ProductPerDay); chicken.GetHumanAge(); }
public static void Main() { Chicken chicken = new Chicken("Mara", 3); Console.WriteLine(chicken.ProductPerDay); }
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"); }
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); } }
public static void Main() { Chicken chicken = new Chicken("Mara", 65); Console.WriteLine(chicken.ProductPerDay); }