// 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.

\n

They 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.

\n

Table 1

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Full years of service Retainer
0 - 2\\$600
3 - 5\\$700
6 - 8\\$800
9 and above\\$900
\n








\n

Table 2

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Monthly salesCommission
\\$500 - \\$79915%
\\$800 - \\$89918%
\\$900 - \\$99921%
\\$1000 and over24%
\n







", "advice": "
\n
\n

Retainer

\n

{name} has been working as a book seller for {years} years. According to Table 1, the retainer is \\${retainer}.

\n

Commission

\n
\n

{name}'s sales for the month were \\${trim(dpformat(sales,0,\"si-en\"))}, so no commission is payable.

\n
\n
\n

{name}'s sales for the month were \\${trim(dpformat(sales,0,\"si-en\"))}. According to Table 2, the commission rate is {commissionrate*100}%.

\n

The 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])}

\n
\n

Income

\n

Income = 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
\n

{name}'s income is \\${trim(dpformat(income,0,\"si-en\"))}.

\n
\n
\n

Rounded to the nearest dollar, {name}'s income is \\${trim(dpformat(income,0,\"si-en\"))}.

\n
", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"years": {"name": "years", "group": "Ungrouped variables", "definition": "random(1 .. 10#0.5)", "description": "
\n
\n
\n
\n
\n

The 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
\n

The 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
\n

The 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
\n

The name of the book seller.

", "templateType": "anything", "can_override": false}, "sales": {"name": "sales", "group": "Ungrouped variables", "definition": "random(250 .. 1650#10)", "description": "
\n
\n
\n

The 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
\n

The 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\"))}.

\n

Calculate {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/"}]}