Write this infix expression in Reverse Polish Notation (RPN): (7 – 2 + 8) / (9 – 5)
- (a)Write this infix expression in Reverse Polish Notation (RPN): (7 – 2 + 8) / (9 – 5)[2]
- (b)Evaluate this RPN expression: a d + a b + c – * when a = 6, b = 3, c = 7 and d = 9 Show the changing contents of the stack as the RPN expression is evaluated.[4]
- (c)Write this RPN expression in infix form: b a c – + d b + * c /[3]
Mark scheme
Marking points from the official mark scheme (May/June 2024). The mark or mark type is shown in brackets.
- [2] One mark 7 2 - 8 +
- [2] One mark 9 5 - /
- [2] Complete answer 7 2 - 8 + 9 5 - /
- [4] One mark per ring (Max 4)
- [4] (Stack trace diagram in MS: 9; 9,6; 15; 15,6; 15,6,3; 15,9; 15,9,7; 15,2; 30)
- [3] One mark per correct term (Max 3) (a - c + b)
- [3] * (d + b)
- [3] /c
- [3] Complete correct answer (((a - c) + b) * (d + b))/c Or (a - c + b) * (d + b)/c
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →