Ejemplo n.º 1
0
        static void Main()
        {
            // AgeChecker a = new AgeChecker(2003, 36, "Houdini", 205);
            AgeChecker b = new AgeChecker();

            //a.Name = "Houdini";
            //a.Age = 36;
            //a.Weight = 199;

            //b.IdNumber = 2002;
            //b.Name = "Cruella";
            //b.Age = 27;
            //b.Weight = 225;

            //  PrintDetails(a);
            //PrintDetails(b);

            Console.ReadLine();

            int tempWeight;

            Console.WriteLine("What is your wight");
            string ageTemp = Console.ReadLine();

            int.TryParse(ageTemp, out tempWeight);
            b.Weight = tempWeight;

            Console.WriteLine($"Your weight is {b.Weight}");
            Console.ReadLine();
        }
Ejemplo n.º 2
0
 public static void PrintDetails(AgeChecker d)
 {
     Console.WriteLine($"my ID number is {d.IdNumber}, my name is {d.Name}, my age is {d.Age} and my weight is {d.Weight}");
 }