Ejemplo n.º 1
0
        public string Get(double radiusD,
                          double widthF,
                          double heightF,
                          double lengthF)
        {
            string result = $"calculate me {radiusD} {widthF} {heightF} {lengthF}";

            if (DoubleValueVerifier.IsDoubleArrayValid(
                    new double[] { radiusD, widthF, heightF, lengthF }))
            {
                CircleModel door   = new CircleModel(radiusD);
                CubeModel   fridge = new CubeModel(widthF, heightF, lengthF);

                result =
                    CalculatorMain.CubeToCircle(door, fridge)
                        ?
                    $"true, door: {door.ToString()}; fridge: {fridge.ToString()}"
                        :
                    $"false, door: {door.ToString()};fridge: {fridge.ToString()}";
            }
            else
            {
                result += "; Some bad value(s)!";
            }

            return(result);
        }
        public string Get(double radiusD,
                          double radiusF)
        {
            string result = $"calculate me {radiusD} {radiusF}";

            if (DoubleValueVerifier.IsDoubleArrayValid(
                    new double[] { radiusD, radiusF }))
            {
                result =
                    CalculatorMain.BallToCircle(new CircleModel(radiusD),
                                                new BallModel(radiusF))
                    ?
                    "true" : "false";
            }
            else
            {
                result += "\nSome bad value(s)!";
            }

            return(result);
        }
        public string Get(double widthD,
                          double heightD,
                          double radiusF)
        {
            string result = $"calculate me {widthD} {heightD} {radiusF}";

            if (DoubleValueVerifier.IsDoubleArrayValid(
                    new double[] { widthD, heightD, radiusF }))
            {
                result =
                    CalculatorMain.BallToSquare(new SquareModel(widthD, heightD),
                                                new BallModel(radiusF))
                    ?
                    "true" : "false";
            }
            else
            {
                result += "\nSome bad value(s)!";
            }

            return(result);
        }
        public string Get(double widthD,
                          double heightD,
                          double widthF,
                          double heightF,
                          double lengthF)
        {
            string result = $"calculating {widthD} {heightD} {widthF} {heightF} {lengthF}";

            if (DoubleValueVerifier.IsDoubleArrayValid(
                    new double[] { widthD, heightD, widthF, heightF, lengthF }))
            {
                result =
                    CalculatorMain.CubeToSquare(new SquareModel(widthD, heightD),
                                                new CubeModel(widthF, heightF, lengthF))
                                        ?
                    "true" : "false";
            }
            else
            {
                result += "\nSome bad value(s)!";
            }

            return(result);
        }