Here’s Google calculator: calculator - YouTube
If you input this on a TI-84 its a syntax error.
5 * - + 5
could be interpreted as:
- 5 * (-5) = -25
- 5 - 5 = 0
- 5 + 5 = 10
So I feel like this story is unfair.
Here’s Google calculator: calculator - YouTube
If you input this on a TI-84 its a syntax error.
5 * - + 5
could be interpreted as:
So I feel like this story is unfair.
the story you are referring to (pasted below for ref)
User Story #13: If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative (
-
) sign). For example, if5 + * 7 =
is entered, the result should be35
(i.e.5 * 7
); if5 * - 5 =
is entered, the result should be-25
(i.e.5 * (-5)
).
In a way it is ‘unfair’ if we are judging it on how closely it defines the action of a real calculator. But in this case, it is just a rule to help you work on your coding skills and doesn’t need to make sense in the real world. (You can always fork the code after you’re done and then change this feature to be the way you believe it should work)
It’s very unlikely any certification project criteria will change.
In any case, the instructions say this should produce the result 10
If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative (
-
) sign).
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.