When viewing the description property of the CalculatorBrain, the operators need parentheses to indicate correct precedence.
For example, enter "7 + 7 x 2" into the calculator.
Analyzing this expression on its own, you'd expect the answer to be "21": (7 + (7 x 2))
However, the calculator displays the value "28": ((7 + 7) * 2). This answer is correct given the order of input, but incorrect when looking at the expression "7 + 7 x 2" shown in the display.
We should include extra parentheses in the description functions for each binary operation so that the correct operator precedence can be inferred from the display.
When viewing the description property of the CalculatorBrain, the operators need parentheses to indicate correct precedence.
For example, enter "7 + 7 x 2" into the calculator.
We should include extra parentheses in the description functions for each binary operation so that the correct operator precedence can be inferred from the display.