/// <summary> /// Perform subtraction and store operation in history. /// </summary> public void Subtraction() { DisplayNumber = FirstOperand - SecondOperand; OperationsHistory.Insert(0, string.Format(FirstOperand + " - " + SecondOperand + " =\n" + DisplayNumber + "\n\n")); FirstOperand = DisplayNumber; }
/// <summary> /// Perform multiplication and store operation in history. /// </summary> public void Multiplication() { DisplayNumber = FirstOperand * SecondOperand; OperationsHistory.Insert(0, string.Format(FirstOperand + " \u00d7 " + SecondOperand + " =\n" + DisplayNumber + "\n\n")); FirstOperand = DisplayNumber; }
/// <summary> /// Perform division and store operation in history. /// </summary> public void Division() { DisplayNumber = FirstOperand / SecondOperand; OperationsHistory.Insert(0, string.Format(FirstOperand + " \u00f7 " + SecondOperand + " =\n" + DisplayNumber + "\n\n")); FirstOperand = DisplayNumber; }