namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_24
{
    using System;

    public class ExceptionHandling
    {
        public static int Main()
        {
            string firstName;
            string ageText;
            int age;
            int result = 0;

            Console.Write("Wprowadź imię: ");
            firstName = Console.ReadLine();

            Console.Write("Wprowadź wiek: ");
            ageText = Console.ReadLine();

            try
            {
                age = int.Parse(ageText);
                Console.WriteLine(
                  $"Hej, {firstName}! Twój wiek w miesiącach to { age * 12 }.");
            }
            finally
            {
                Console.WriteLine($"Żegnaj, { firstName }!");
            }

            return result;
        }
    }
}