Пример #1
0
 /// <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;
 }
Пример #2
0
 /// <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;
 }
Пример #3
0
 /// <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;
 }