static void Main() { ShapeType typeOfShape = GetTypeOfShape(); TypeOfOperation typeOfOperation = GetTypeOfOperation(typeOfShape); double userValue = GetUserValue(typeOfShape); GeometricShape shape = new GeometricShape(typeOfShape, userValue); double result = Calculate(shape, typeOfOperation); ShowSizesCalculations(result, typeOfOperation, typeOfShape); GeometricPatameter hypotheticalResults = GetHypotheticalResults(typeOfShape, typeOfOperation, result); ShowSizesHypotheticalCalculations(hypotheticalResults, typeOfOperation, typeOfShape); Console.ReadKey(); }
static double Calculate(GeometricShape shape, TypeOfOperation typeOfOperation) { double result = 0; switch (typeOfOperation) { case TypeOfOperation.Perimeter: result = shape.GetPerimeterOfShape(); break; case TypeOfOperation.Square: result = shape.GetSquareOfShape(); break; } return(result); }