Пример #1
0
        public Tuple <double, string, int> output(string One = "0", string two = "0", string three = "0", int tip = 0)
        {
            SOneValue   RK = new SOneValue();
            SThreeValue TS = new SThreeValue();
            TipFigurs   TP = new TipFigurs();

            if (two == "" && three == "")
            {
                two   = "0";
                three = "0";
            }

            string tp = TP.TipsFigur(One, two, three);

            switch (tip)
            {
            case 0:
                if (tp == "Круг")
                {
                    return(Tuple.Create <double, string, int> (RK.SRoundRadius(One), tp, tip));
                }
                else
                {
                    return(Tuple.Create <double, string, int> (TS.STriangleThreeSide(One, two, three), tp, tip));
                }
                break;

            case 1:
                return(Tuple.Create <double, string, int> (RK.SRoundRadius(One), tp, tip));

                break;

            case 2:
                return(Tuple.Create <double, string, int> (TS.STriangleThreeSide(One, two, three), tp, tip));

                break;

            default:
                return(Tuple.Create <double, string, int> (0, "Ошибка", tip));

                break;
            }
        }
Пример #2
0
        //Проверяет тип фигуры
        public string TipsFigur(string a, string b, string c)
        {
            TipFigurs     TP = new TipFigurs();
            provercaValue PV = new provercaValue();
            double        a1 = PV.InValue(a, b, c).Item1;
            double        b1 = PV.InValue(a, b, c).Item2;
            double        c1 = PV.InValue(a, b, c).Item3;

            //Проверка количество введённых значений
            if (a1 != 0 && b1 == 0 && c1 == 0)
            {
                return("Круг");
            }
            else if (a1 != 0 && b1 != 0 && c1 != 0)
            {
                return(TP.TipTriang(a, b, c));
            }
            else
            {
                return("Ошибка");
            }
        }