// Numbas version: finer_feedback_settings {"name": "Nuala's copy of Numerical reasoning - tax", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"commanumber": {"definition": "var parts=n.toString().split(\".\");\n if(parts[1] && parts[1].length<2) {\n parts[1]+='0';\n }\n return parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + (parts[1] ? \".\" + parts[1] : \"\");", "type": "string", "parameters": [["n", "number"]], "language": "javascript"}}, "ungrouped_variables": ["salary", "aftertax", "incomepermonth", "his", "name", "netincome", "pensiondeduction", "tax", "pension", "taxedincome", "he", "allowance"], "name": "Nuala's copy of Numerical reasoning - tax", "tags": ["income", "money", "numerical reasoning", "percentage", "tax"], "advice": "

{name} is only taxed on the amount remaining after taking away the allowance, i.e. $£\\var{commanumber(salary)} - £\\var{commanumber(allowance)} = £\\var{commanumber(salary-allowance)}.$

\n

Income tax is {tax}% on this $£\\var{commanumber(salary-allowance)}$ and is $£\\var{latex(commanumber(salary-allowance))} \\times \\frac{\\var{tax}}{100}  = £\\var{commanumber(taxedincome)}.$

\n

This leaves {name} with $£\\var{commanumber(salary)} - £\\var{commanumber(taxedincome)} = £\\var{commanumber(aftertax)}.$

\n

{pension}% of this is for {his} pension contributions, i.e. $£\\var{commanumber(aftertax)} \\times \\frac{\\var{pension}}{100} = £\\var{commanumber(pensiondeduction)}.$

\n

The amount left is then $£\\var{commanumber(aftertax)} - £\\var{commanumber(pensiondeduction)} = £\\var{commanumber(precround(netincome,2))}.$

\n

The take home pay per month is hence $\\frac{\\var{netincome}}{12} = £\\var{commanumber(incomepermonth)}$, to the nearest penny.

", "rulesets": {}, "parts": [{"prompt": "

How much does {he} get per month, assuming that these are the only deductions?

\n

£ [[0]] (to the nearest penny)

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"precisionType": "dp", "precisionMessage": "", "allowFractions": false, "variableReplacements": [], "precision": 2, "maxValue": "incomepermonth", "variableReplacementStrategy": "originalfirst", "strictPrecision": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 100, "scripts": {}, "marks": 1, "minValue": "incomepermonth", "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "statement": "

{name} has a salary of £{commanumber(salary)} per year.

\n

{capitalise(he)} has a tax allowance of £{commanumber(allowance)} and {he} pays income tax at {tax}% on the rest.

\n

{capitalise(he)} pays into a pension and for this {his} salary is deducted {pension}% after tax has been deducted.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"salary": {"definition": "random(18000..50000#1000)", "templateType": "anything", "group": "Ungrouped variables", "name": "salary", "description": ""}, "aftertax": {"definition": "salary-taxedincome", "templateType": "anything", "group": "Ungrouped variables", "name": "aftertax", "description": ""}, "incomepermonth": {"definition": "precround(netincome/12,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "incomepermonth", "description": ""}, "his": {"definition": "if(he='he','his','her')", "templateType": "anything", "group": "Ungrouped variables", "name": "his", "description": ""}, "name": {"definition": "if(he='he',random(['Bob','Bill','Ben','Barry']),random(['Bridget','Beth','Bea','Beatrice']))", "templateType": "anything", "group": "Ungrouped variables", "name": "name", "description": ""}, "netincome": {"definition": "(allowance+(salary-allowance)*(1-tax/100))*(1-pension/100)", "templateType": "anything", "group": "Ungrouped variables", "name": "netincome", "description": ""}, "pensiondeduction": {"definition": "aftertax*pension/100", "templateType": "anything", "group": "Ungrouped variables", "name": "pensiondeduction", "description": ""}, "tax": {"definition": "random(15..30)", "templateType": "anything", "group": "Ungrouped variables", "name": "tax", "description": ""}, "pension": {"definition": "random(3..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "pension", "description": ""}, "taxedincome": {"definition": "(salary-allowance)*tax/100", "templateType": "anything", "group": "Ungrouped variables", "name": "taxedincome", "description": ""}, "he": {"definition": "random('he','she')", "templateType": "anything", "group": "Ungrouped variables", "name": "he", "description": ""}, "allowance": {"definition": "random(1000..10000#1000)", "templateType": "anything", "group": "Ungrouped variables", "name": "allowance", "description": ""}}, "metadata": {"notes": "", "description": "

Given an annual salary, tax allowance, tax rate and pension deduction, work out a person's take-home pay per month.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Nuala Davis", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/821/"}]}]}], "contributors": [{"name": "Nuala Davis", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/821/"}]}