// Numbas version: exam_results_page_options {"name": "Percentages: In Context - Calculating income based on commission", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Percentages: In Context - Calculating income based on commission", "tags": [], "metadata": {"description": "
Calculating a salesperson's income based on years of service and commission from sales
", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "An educational book seller pays its sales staff a monthly retainer (base level of pay) depending on their years of service. The retainer is given in Table 1 below.
\nThey also pay a commission based on the sales person's total sales for the month. If sales are below \\$500, no commission is paid. Otherwise, the commission is given in Table 2 below.
\nTable 1
\nFull years of service | \nRetainer | \n
0 - 2 | \n\\$600 | \n
3 - 5 | \n\\$700 | \n
6 - 8 | \n\\$800 | \n
9 and above | \n\\$900 | \n
Table 2
\nMonthly sales | \nCommission | \n
\\$500 - \\$799 | \n15% | \n
\\$800 - \\$899 | \n18% | \n
\\$900 - \\$999 | \n21% | \n
\\$1000 and over | \n24% | \n
Retainer
\n{name} has been working as a book seller for {years} years. According to Table 1, the retainer is \\${retainer}.
\nCommission
\n{name}'s sales for the month were \\${trim(dpformat(sales,0,\"si-en\"))}, so no commission is payable.
\n{name}'s sales for the month were \\${trim(dpformat(sales,0,\"si-en\"))}. According to Table 2, the commission rate is {commissionrate*100}%.
\nThe commission earnt is {commissionrate*100}% of \\${trim(dpformat(sales,0,\"si-en\"))}.
\n{commissionrate*100}% of \\${trim(dpformat(sales,0,\"si-en\"))} = {commissionrate} x \\${trim(dpformat(sales,0,\"si-en\"))} = \\${trim(split(dpformat(commissionrate*sales,2,\"si-en\"),\".00\")[0])}
\nIncome
\nIncome = Retainer + Commission = \\${trim(split(dpformat(retainer,2,\"si-en\"),\".00\")[0])} + \\${trim(split(dpformat(commissionrate*sales,2,\"si-en\"),\".00\")[0])} = \\${trim(split(dpformat(retainer+commissionrate*sales,2,\"si-en\"),\".00\")[0])}
\n{name}'s income is \\${trim(dpformat(income,0,\"si-en\"))}.
\nRounded to the nearest dollar, {name}'s income is \\${trim(dpformat(income,0,\"si-en\"))}.
\nThe number of years that the bookseller has been working for the company.
", "templateType": "randrange", "can_override": false}, "income": {"name": "income", "group": "Ungrouped variables", "definition": "retainer+commissionrate*sales", "description": "\n\n\n\nThe income, based on retainer plus commission.
", "templateType": "anything", "can_override": false}, "retainer": {"name": "retainer", "group": "Ungrouped variables", "definition": "switch({years}<3,600,{years}<6,700,{years}<9,800,900)", "description": "\n\n\n\nThe retainer paid, based on the years of service.
", "templateType": "anything", "can_override": false}, "name": {"name": "name", "group": "Ungrouped variables", "definition": "random(\"Maria\",\"Frances\",\"Maysa\",\"Gia\",\"Lin\",\"Yousif\",\"James\")", "description": "\n\n\nThe name of the book seller.
", "templateType": "anything", "can_override": false}, "sales": {"name": "sales", "group": "Ungrouped variables", "definition": "random(250 .. 1650#10)", "description": "\n\n\nThe dollar value of the sales for the given month.
", "templateType": "randrange", "can_override": false}, "commissionrate": {"name": "commissionrate", "group": "Ungrouped variables", "definition": "switch({sales}<500,0,{sales}<800,0.15,{sales}<900,0.18,{sales}<1000,0.21,0.24)", "description": "\n\nThe commission rate as a decimal, based on the monthly sales amount.
", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["name", "years", "retainer", "sales", "commissionrate", "income"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "{name} has been working for the book selling company for {years} years. Last month, {name} sold books worth a total of \\${trim(dpformat(sales,0,\"si-en\"))}.
\nCalculate {name}'s before-tax income for the month. Enter your answer, rounded to the nearest dollar.
\n\\$[[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "income", "maxValue": "income", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": 0, "precisionPartialCredit": "50", "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Adelle Colbourn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2083/"}, {"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}]}], "contributors": [{"name": "Adelle Colbourn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2083/"}, {"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}