
Reverse Polish notation practice for AQA A Level Computer Science (7517):
twenty different worksheets on converting to and from RPN and evaluating it
with a stack, each with a complete answer key.
The specification asks students to convert expressions from infix to Reverse
Polish “and vice versa”. Most resources only show the first direction. Every
sheet here does both: question 1 converts an infix expression to RPN, and
question 2 converts a different RPN expression back to infix.
WHAT YOU GET
- 20 worksheets, 2 pages each, numbered 01 to 20
- 20 matching answer keys
- A contents table listing the expression each sheet asks to convert, so you
can pick one without opening all twenty
WHAT IS ON EVERY SHEET
Question 1 converts infix to Reverse Polish. Question 2 converts Reverse
Polish back to infix, with brackets showing the order of evaluation. Question
3 evaluates an RPN expression with a stack in a trace table, one row per token
read, with the first row completed. Question 4 asks why RPN needs no brackets
and why interpreters store expressions in it.
Sheets run from 17 to 19 marks.
THREE PLACES A QUESTION COULD HAVE HAD TWO ANSWERS
Precedence and associativity are stated in the conventions at the top of every
sheet: times and divide before plus and minus, equal precedence left to right.
The order of the operands of a subtraction - the slip where a b - is read as
b - a - is stated too, with a worked example.
And the expressions themselves are bracketed so that they say what they mean
under that left-to-right rule. An expression like A * B * C looks harmless,
but if the intended grouping is A * (B * C) then a student following the
printed rule would produce a different RPN and be marked wrong for doing
exactly what the sheet told them. Every expression in this pack is printed
with the brackets that make its order unambiguous, and no more.
Every expression to be evaluated was generated so that no intermediate result
is negative or fractional: a student who reaches one knows they have slipped.
WRITTEN FOR AQA
The specification wording is “be able to convert simple expressions in infix
form to Reverse Polish notation (RPN) form and vice versa”, with “eliminates
need for brackets in sub-expressions” and “expressions in a form suitable for
evaluation using a stack” in the notes beside it - AQA 7517, section 4.3.3,
printed in the header of every page. Question 4’s answers use those words.
This is an AQA topic: OCR H446 does not name Reverse Polish notation, so these
sheets are shaped for AQA and are not offered as an OCR resource.
FORMAT
PDF, A4, print-ready. Twenty genuinely different versions, so you already have
a fresh sheet for every class, every resit and every homework.
Licensed for the purchasing teacher and their own classes.
Something went wrong, please try again later.
This resource hasn't been reviewed yet
To ensure quality for our reviews, only customers who have purchased this resource can review it
Report this resourceto let us know if it violates our terms and conditions.
Our customer service team will review your report and will be in touch.