Flora has written a program that uses the variables a, b, c and d. Part of the program contains the following calculations: a = 2 b = 5 c = 7 d = a * b – (a + b + c) Write the Reverse Polish Notation (RPN) for the expression: a * b – (a + b + c) Show the changing contents of the stack as the value for variable d is calculated from the RPN expression. Convert the following RPN expression back to its original infix form. d b * b c d + - + a / Explain why expressions are evaluated using RPN. 9608_w21_qp_31 THEORY 2021 Paper 3, Variant 1 View
Flora has written a program that uses the variables a, b, c and d. Part of the program contains the following calculations: a = 2 b = 5 c = 7 d = a * b – (a + b + c) Write the Reverse Polish Notation (RPN) for the expression: a * b – (a + b + c) Show the changing contents of the stack as the value for variable d is calculated from the RPN expression. Convert the following RPN expression back to its original infix form. d b * b c d + - + a / Explain why expressions are evaluated using RPN. 9608_w21_qp_33 THEORY 2021 Paper 3, Variant 3 View