public void Calculate(Numbers numbers) { if (numbers.GetOperation() == "*") { Console.WriteLine("Result: " + (numbers.GetNumber1() * numbers.GetNumber2())); } else { Console.WriteLine("Error occured"); } }
public void Calculate(Numbers numbers) { if (numbers.GetOperation() == "-") { Console.WriteLine("Result: " + (numbers.GetNumber1() - numbers.GetNumber2())); } else { nextInChain.Calculate(numbers); } }