// Numbas version: exam_results_page_options {"name": "Ratios: In Context - Currency conversion with commission", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Ratios: In Context - Currency conversion with commission", "tags": [], "metadata": {"description": "

Given the exchange rate between two currencies and the bank's commission rate, calculate how much of one currency you will get for $x$ amount of the other

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

The exchange rate between the Dollar and the Euro is $\\$1 = €\\var{exchange}$ and the Bank charges $\\var{commision}$% commission.

\n

(Round to the nearest cent)

", "advice": "

PART 1
There are two methods you can use.

METHOD 1

$\\frac{€\\var{numberone}}{€\\var{exchange}} \\times \\$1 = \\$\\var{precround(ans1,3)}$  (Total amount without commission removed)

\n

Commision =$ \\frac{\\var{commision}}{100} \\times \\var{precround(ans1,3)}$

\n

Final amount after commission removed = $\\$\\var{precround(ans1,3)} - (\\frac{\\var{commision}}{100} \\times \\var{precround(ans1,3)})$ = $\\$\\var{precround(ansone,2)}$

METHOD 2

It would be slightly quicker to remove the commision as a percentage first, i.e. $100 - \\var{commision} = \\var{100-commision}$, 
Then calculate the conversion, and remove the commision in one calculation:

\n

Final amount after commission removed =$\\frac{€\\var{numberone}}{€\\var{exchange}} \\times \\frac{\\var{100 - commision}}{100} =\\$\\var{precround(ansone,2)}$


\n

PART 2

\n

To calculate how many Euro you get from $\\$\\var{numbertwo}:$

\n

$\\frac{\\$\\var{numbertwo}}{\\$1} \\times €\\var{exchange}  = €\\var{precround(ans2,3)}$ (Total amount without commission removed)

\n

Commision =$ \\frac{\\var{commision}}{100} \\times \\var{precround(ans2,3)}$

\n

Final amount after commission removed =$ €\\var{precround(ans2,3)} - (\\frac{\\var{commision}}{100} \\times \\var{precround(ans2,3)})$ = $€\\var{precround(anstwo,2)}$ 

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"numberone": {"name": "numberone", "group": "Ungrouped variables", "definition": "random(600..800)", "description": "", "templateType": "anything", "can_override": false}, "ans2": {"name": "ans2", "group": "Ungrouped variables", "definition": "({numbertwo)*{exchange}", "description": "", "templateType": "anything", "can_override": false}, "exchange": {"name": "exchange", "group": "Ungrouped variables", "definition": "random(0.61..0.91#0.02)", "description": "", "templateType": "anything", "can_override": false}, "ansthree": {"name": "ansthree", "group": "Ungrouped variables", "definition": "{ans3} - ({ans3}*(commision)/100)", "description": "", "templateType": "anything", "can_override": false}, "numberfour": {"name": "numberfour", "group": "Ungrouped variables", "definition": "random(800..950 except {numberone} {numbertwo} {numberthree})", "description": "", "templateType": "anything", "can_override": false}, "commision": {"name": "commision", "group": "Ungrouped variables", "definition": "random(1.1..2.9#0.1)", "description": "", "templateType": "anything", "can_override": false}, "numbertwo": {"name": "numbertwo", "group": "Ungrouped variables", "definition": "random(300..600 except {numberone})", "description": "", "templateType": "anything", "can_override": false}, "ansfour": {"name": "ansfour", "group": "Ungrouped variables", "definition": "{ans4} - ({ans4}*(commision)/100)", "description": "", "templateType": "anything", "can_override": false}, "ans1": {"name": "ans1", "group": "Ungrouped variables", "definition": "({numberone}/{exchange})", "description": "", "templateType": "anything", "can_override": false}, "anstwo": {"name": "anstwo", "group": "Ungrouped variables", "definition": "{ans2} - ({ans2}*(commision)/100)", "description": "", "templateType": "anything", "can_override": false}, "numberthree": {"name": "numberthree", "group": "Ungrouped variables", "definition": "random(150..300 except {numberone} {numbertwo})", "description": "", "templateType": "anything", "can_override": false}, "ansone": {"name": "ansone", "group": "Ungrouped variables", "definition": "{ans1} - ({ans1}*(commision)/100)", "description": "", "templateType": "anything", "can_override": false}, "ans3": {"name": "ans3", "group": "Ungrouped variables", "definition": "({numberthree}/{exchange})", "description": "", "templateType": "anything", "can_override": false}, "ans4": {"name": "ans4", "group": "Ungrouped variables", "definition": "({numberfour)*{exchange}", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["numberone", "numbertwo", "numberthree", "numberfour", "ans1", "ans3", "ans2", "ans4", "exchange", "commision", "ansone", "ansthree", "anstwo", "ansfour"], "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": "

How many Dollars will I get for €$\\var{numberone}$?

\n

\\$[[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{ansone}", "maxValue": "{ansone}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"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": "

How many Euros will I get for \\$$\\var{numbertwo}$?

\n

€[[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{anstwo}", "maxValue": "{anstwo}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "TEAME CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/591/"}, {"name": "David Goulding", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2365/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}, {"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": "TEAME CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/591/"}, {"name": "David Goulding", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2365/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}, {"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/"}]}