// Numbas version: exam_results_page_options {"name": "Consumer Arithmetic - Rounding and estimating calculations - adding up prices in a shop", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Consumer Arithmetic - Rounding and estimating calculations - adding up prices in a shop", "advice": "

#### a)

\n

We want to ensure we won't go over the limit, so it is better to overestimate. If we underestimated, we could potentially think we have enough money when we don't.

\n

To overestimate our total, we round each price up.

\n

#### b)

\n

We round up all our values to 1 decimal place:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
 Original prices Rounded up £{p[0]} £{p[1]} £{ice_cream} {pounds(precround(p[0]+0.05,1))} {pounds(precround(p[1]+0.05,1))} {pounds(precround(ice_cream,1))}
\n

Now we calculate the total of these rounded numbers:

\n

\\[ \\var{pounds(precround(p[0]+0.05,1))} + \\var{pounds(precround(p[1]+0.05,1))} + \\var{pounds(precround(ice_cream,1))} = \\var{pounds(total_rounded_up)} \\]

\n

#### c)

\n

As the estimated total, £{dpformat(total_rounded_up,2)}, is {if(can_afford,'lower','higher')} than £{cash}, we {if(can_afford,'do have','may not have')} enough money to purchase the {flavour} ice cream.

", "tags": [], "statement": "

Imagine you are shopping at the supermarket. You only have \\\${cash} in cash. There are two items in your basket so far, costing {currency(p[0],\"\\\$\",\"c\")} and {currency(p[1],\"\\\$\",\"c\")}.

\n

Just before checkout, you notice a tasty {flavour} ice cream on the shelf. It costs {currency(ice_cream,\"\\\$\",\"c\")}. Can you put this in your basket without going over your limit?

", "functions": {"pounds": {"language": "jme", "type": "string", "definition": "if(n>=1,currency(n,\"\u00a3\",\"\"), \"\u00a3\"+dpformat(n,2))", "parameters": [["n", "number"]]}}, "extensions": [], "ungrouped_variables": [], "preamble": {"js": "", "css": ""}, "rulesets": {}, "parts": [{"marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "prompt": "

If we don't want to underestimate the total price of these items, do we round the individual prices up, or down?

\n

[[0]]

", "sortAnswers": false, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "matrix": ["1", "0"], "displayColumns": 0, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "maxMarks": 0, "displayType": "radiogroup", "distractors": ["", ""], "type": "1_n_2", "choices": ["

Round up.

", "

Round down.

"], "shuffleChoices": false, "minMarks": 0, "variableReplacementStrategy": "originalfirst", "unitTests": []}]}, {"marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "prompt": "

Estimate the total price if we buy the ice cream, rounding the price of each item to 1 decimal place.

\n

\$ [[0]]

\n

", "sortAnswers": false, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"customMarkingAlgorithm": "", "variableReplacements": [], "precisionPartialCredit": 0, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "showFeedbackIcon": true, "mustBeReduced": false, "minValue": "total_rounded_up", "strictPrecision": false, "allowFractions": false, "type": "numberentry", "showPrecisionHint": false, "correctAnswerFraction": false, "unitTests": [], "mustBeReducedPC": 0, "marks": 1, "precisionType": "dp", "precision": "2", "scripts": {}, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "precisionMessage": "You have not given your answer to the correct precision.", "notationStyles": ["plain", "en", "si-en"], "maxValue": "total_rounded_up"}]}, {"marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "prompt": "

Can we be sure that we have enough cash to pay for all three items?

\n

[[0]]

", "sortAnswers": false, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "matrix": "if(can_afford,[1,0],[0,1])", "displayColumns": 0, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "maxMarks": 0, "displayType": "radiogroup", "type": "1_n_2", "choices": ["

Yes, we do have enough cash.

", "

No, we may not have enough.

"], "shuffleChoices": false, "minMarks": 0, "variableReplacementStrategy": "originalfirst", "unitTests": []}]}], "variable_groups": [{"name": "Randoms", "variables": ["p", "ice_cream", "total_rounded_up", "can_afford", "cash", "flavour"]}, {"name": "Answers", "variables": []}], "variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Estimate whether you can afford an extra item in a shop by rounding prices to the nearest 10p.

"}, "variables": {"can_afford": {"name": "can_afford", "group": "Randoms", "description": "

Can we afford all three items?

", "definition": "random(true,false)", "templateType": "anything"}, "total_rounded_up": {"name": "total_rounded_up", "group": "Randoms", "description": "

Total price of the three items when rounding up.

", "definition": "precround(p[0]+0.05,1) + precround(p[1]+0.05,1) + precround(ice_cream,1)", "templateType": "anything"}, "flavour": {"name": "flavour", "group": "Randoms", "description": "

Flavour of the ice cream.

", "definition": "random(\"strawberry cheesecake\", \"cookie dough\", \"mint chocolate chip\", \"vanilla\", \"raspberry\", \"Neapolitan\")", "templateType": "anything"}, "ice_cream": {"name": "ice_cream", "group": "Randoms", "description": "

Price of the ice cream

", "definition": "(random(100..380#10)+9)/100", "templateType": "anything"}, "p": {"name": "p", "group": "Randoms", "description": "

Prices of the first two items.

", "definition": "repeat((random(30..200 #10) + random(1..9))/100,2)", "templateType": "anything"}, "cash": {"name": "cash", "group": "Randoms", "description": "

Amount of cash we have.

", "definition": "if(can_afford,\n ceil(total_rounded_up)\n ,\n ceil(sum(p)+ice_cream)-1\n)\n ", "templateType": "anything"}}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Paul Hancock", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1738/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Paul Hancock", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1738/"}]}