void PrintErrorMessage(double x, String message, IFunction function) { String type = function.GetType().Name; switch (type) { case "Hyperbola": Console.WriteLine($"{type}( {function.At(0)}/x ) = {message}, where x = {x}"); break; case "Logarithm": Console.WriteLine($"{type}( Log{function.At(0)}(x) ) = {message}, where x = {x}"); break; } }
void PrintResult(double x, double result, IFunction function) { String type = function.GetType().Name; switch (type) { case "Hyperbola": Console.WriteLine($"{type}( {function.At(0)}/x ) = {result}, where x = {x}"); break; case "Parabola": Console.WriteLine($"{type}( {function.At(0)}*x^2 + {function.At(1)}*x + {function.At(2)} ) = {result}, where x = {x}"); break; } }