// Numbas version: exam_results_page_options {"name": "Lois'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", "language": "javascript", "parameters": [["n", "number"]]}}, "ungrouped_variables": ["salary", "aftertax", "incomepermonth", "his", "name", "netincome", "pensiondeduction", "tax", "pension", "taxedincome", "he", "allowance"], "name": "Lois's copy of Numerical reasoning - tax", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

{name} is only taxed on  $£\\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 \\var{taxdec}  = £\\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 \\var{pensiondec} = £\\var{commanumber(pensiondeduction)}.$

\n

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

\n

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

\n

You can find more information about calculating percentages in the Mathcentre leaflets available at http://www.mathscentre.ac.uk/types/quick-reference/percentages/

\n

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

Assuming that the only deductions from {his} salary are income tax and pension contributions, how much does {he} take home per month?

\n

\n

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

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

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

\n

{capitalise(he)} does not pay tax on the first £{commanumber(allowance)} of {his} salary, but pays income tax at {tax}% on the rest.

\n

{capitalise(he)} also pays a pension contribution, which is {pension}% of {his} salary after tax has been deducted.

", "variable_groups": [{"variables": ["taxdec", "pensiondec"], "name": "Unnamed group"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "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": ""}, "pensiondec": {"definition": "pension/100\n", "templateType": "anything", "group": "Unnamed group", "name": "pensiondec", "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": ""}, "taxdec": {"definition": "tax/100\n", "templateType": "anything", "group": "Unnamed group", "name": "taxdec", "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": {"description": "

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

\n

Used in Calculator Test.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}]}], "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}