Пример #1
0
        public static void Main(string[] args)
        {
            try
            {
                var round = new Round(1, 1, 4);
                var ring  = new Ring();

                while (EndProgram.Repeat)
                {
                    Console.WriteLine($"{round.Display()}\n");

                    Console.Write("Enter the outer radius of the ring: ");
                    ring.OutteR = int.Parse(Console.ReadLine());

                    Console.Write("Enter the inner radius of the ring: ");
                    ring.InneR = int.Parse(Console.ReadLine());

                    Console.Write("Enter the coordinates of the center of the ring: \nX: ");
                    ring.X = int.Parse(Console.ReadLine());

                    Console.Write("Y: ");
                    ring.Y = int.Parse(Console.ReadLine());

                    Console.WriteLine(ring.Display());

                    EndProgram.WhileExit();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"ERROR: {ex.Message}");
            }
        }
        public static void Main(string[] args)
        {
            while (EndProgram.Repeat)
            {
                try
                {
                    Console.WriteLine("Enter String: ");
                    var str = Console.ReadLine();
                    Console.WriteLine("The string {0} is a number.", str.CheckPositiveOfNumber() ? " " : "Not");

                    EndProgram.WhileExit();
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"ERROR: {ex.Message}");
                }
            }
        }