예제 #1
0
        public static void Trapezium()
        {
            Console.OutputEncoding = Encoding.UTF8;
            try
            {
                Console.WriteLine("Enter the value of points x1, y1: ");
                x1 = int.Parse(Console.ReadLine());
                y1 = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter the value of points x2,y2: ");
                x2 = int.Parse(Console.ReadLine());
                y2 = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter the value of points x3,y3: ");
                x3 = int.Parse(Console.ReadLine());
                y3 = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter the value of points x4,y4: ");
                x4 = int.Parse(Console.ReadLine());
                y4 = int.Parse(Console.ReadLine());

                Trapezium trapezium = new Trapezium(x1, x2, x3, x4, y1, y2, y3, y4);

                if (trapezium.FigureArea() is 0)
                {
                    ExeptionFilter.ExeptionOutputENG();
                    ChangeTrapezium();
                }
                else
                {
                    trapezium.DrawENG();
                    SelectENG.NextChangeENG();
                }
            }
            catch
            {
                ExeptionFilter.ExeptionOutputENG();
                Trapezium();
            }
        }
예제 #2
0
        public static void Trapezium()
        {
            Console.OutputEncoding = Encoding.UTF8;
            try
            {
                Console.WriteLine("Введите значение точек x1, y1: ");
                x1 = int.Parse(Console.ReadLine());
                y1 = int.Parse(Console.ReadLine());
                Console.WriteLine("Введите значение точек x2,y2: ");
                x2 = int.Parse(Console.ReadLine());
                y2 = int.Parse(Console.ReadLine());
                Console.WriteLine("Введите значение точек x3,y3: ");
                x3 = int.Parse(Console.ReadLine());
                y3 = int.Parse(Console.ReadLine());
                Console.WriteLine("Введите значение точек x4,y4: ");
                x4 = int.Parse(Console.ReadLine());
                y4 = int.Parse(Console.ReadLine());

                Trapezium trapezium = new Trapezium(x1, x2, x3, x4, y1, y2, y3, y4);

                if (trapezium.FigureArea() is 0)
                {
                    ExeptionFilter.ExeptionOutputENG();
                    ChangeTrapezium();
                }
                else
                {
                    trapezium.Draw();
                    SelectRUS.NextChange();
                }
            }
            catch
            {
                ExeptionFilter.ExeptionOutputENG();
                Trapezium();
            }
        }