1. Order of Precedence . Evaluate each expression listed below step by step . Ea
ID: 3750809 • Letter: 1
Question
1. Order of Precedence . Evaluate each expression listed below step by step . Each step can only advance the calculation by one operation. * Show each step of the evaluation of the complete statement according to the order of precedence that would be completed by the computer * Continue to show step by step until the problem has been solved At the end show the current value of "a" and "d" they did not change or were not in expressiOL. For each statement assume that a =1 and d = 1.0 before the evaluation. . You can use ECLIPSE to check your answer Here is an example a 23/2-7 *5 Evaluation: a 11- 35 a 11-7 5 d= 1.0 show both values in your final answer a- Expressions to evaluate: a) a 46 96 9 + 4 * 4-2 b) a-45 + 43 % 5 * (23 * 3 962) e) d--1.5*3 +a++Explanation / Answer
The expressions could be evaluated by following the order of precedence of the operators as followed by compilers. The order of preference of arithmetic operators is :
()
++,--
*,/,%
+,-
+=,-=,*=,/=,%=
When there are two or more operators of the same precedence in an expression, we evaluate the expression according to the associativity of operators. In case of arithmetic operators, all are associated from left to right except prefix increment and decrement operators and compound assignment operators.
Hence, the expressions are evaluated in the following manner.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.