Пример #1
0
        public string PrintCount(GeometricShape shape)
        {
            switch (shape.TypeE)
            {
            case Classes.EGeometricShapes.Circle:
                return(shape.Count + " " + (shape.Count == 1 ? "Circle" : "Circles"));

            case Classes.EGeometricShapes.EquilateralTriangle:
                return(shape.Count + " " + (shape.Count == 1 ? "Equilateral triangle" : "Equilateral Triangles"));

            case Classes.EGeometricShapes.Square:
                return(shape.Count + " " + (shape.Count == 1 ? "Square" : "Squares"));

            case Classes.EGeometricShapes.Trapeze:
                return(shape.Count + " " + (shape.Count == 1 ? "Trapeze" : "Trapezoids"));

            case Classes.EGeometricShapes.Rectangle:
                return(shape.Count + " " + (shape.Count == 1 ? "Rectangle" : "Rectangles"));

            default:
                return("");
            }
        }
Пример #2
0
        public string PrintCount(GeometricShape shape)
        {
            switch (shape.TypeE)
            {
            case Classes.EGeometricShapes.Circle:
                return(shape.Count + " " + (shape.Count == 1 ? "Círculo" : "Círculos"));

            case Classes.EGeometricShapes.EquilateralTriangle:
                return(shape.Count + " " + (shape.Count == 1 ? "Triangulo Equilatero" : "Triángulos Equilateros"));

            case Classes.EGeometricShapes.Square:
                return(shape.Count + " " + (shape.Count == 1 ? "Cuadrado" : "Cuadrados"));

            case Classes.EGeometricShapes.Trapeze:
                return(shape.Count + " " + (shape.Count == 1 ? "Trapezoide" : "Trapezoides"));

            case Classes.EGeometricShapes.Rectangle:
                return(shape.Count + " " + (shape.Count == 1 ? "Rectangulo" : "Rectangulos"));

            default:
                return("");
            }
        }
Пример #3
0
 public string PrintPerimeter(GeometricShape shape)
 {
     return($"Perimeter: {shape.Perimeter:#.##} <br/>");
 }
Пример #4
0
 public string PrintArea(GeometricShape shape)
 {
     return($"Area: {shape.Area:#.##}");
 }