(15 points) Assume the following rules of associativity and precedence for expre
ID: 3716034 • Letter: #
Question
(15 points) Assume the following rules of associativity and precedence for expressions: Precedence Highest ,, not &, mod (unary) and or, xor Lowest Associativity Left to right Show the order of evaluation of the following expressions by parenthesizing all subexpressions and placing a superscript on the right parenthesis to indicate order. For example, for the expression a +b* c d the order of evaluation would be represented as ((a(bc)1 2+ d) 3 a. a b1 c b. a (b- 1) cmod d c. (a-b) / c & (d * e / a-3) .-a or c-d and e e. a > b xor c or dExplanation / Answer
[1] a * b - 1 + c
--> (((a * b)1 - 1)2 + c)3
[2] a * (b - 1) / c mod d
--> (((a * (b - 1)1)2 / c)3 mod d)4
[3] (a -b) / c & (d * e / a - 3)
--> (((a-b)1 / c)5 &(((d*e)2/a)3 - 3)4)6
[4] -a or c = d and e
--> ((-a)1 or ((c = d)2 and e)3)4
[5] a > b xor c or d <=17
(((a > b)1 xor c)3 or (d <=17)2)4
[6] -a + b
--> ((-a)1 + b)2
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.