// Numbas version: exam_results_page_options {"name": "Practical 2 Q1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"balances": {"definition": "var cells = [[0,0,0,0,value]];\nvar repayment = (value)/((p)*(an));\n\nfor (i=0; i < n; i++) {\n var tobank;\n if (i <= n) {tobank = repayment;}\n else {tobank = 0;}\n var interest = intdec*cells[i][4];\n var payment = repayment - interest;\n var obalance = cells[i][4] - payment;\n \n cells.push([i+1,tobank,interest,payment,obalance]);\n}\n\nreturn cells;", "type": "list", "parameters": [["an", "number"], ["intdec", "number"], ["n", "number"], ["p", "number"], ["value", "number"]], "language": "javascript"}}, "ungrouped_variables": ["value", "p", "n", "interest", "intdec", "v", "an", "repayment", "balance", "sheet"], "name": "Practical 2 Q1", "tags": [], "advice": "

A loan scehdule can be used to determine the outstanding balance of a loan. A loan schedule consists of two components:

\n
    \n
  1. interest component
  2. \n
  3. repayment component
  4. \n
\n\n

The total number of payments is the number of payments in one year multiplied by the number of years.

\n

total number of payments= $np$

\n

where:

\n\n

In the above question, substituting in $n$={n} and $p$={p} will give the total number of payments.

\n\n

As we know the value of the loan and that the repayment each period is like an annuity, we know that the present value of the annuity multipled by the number of periods in a year will give the value of the loan (see Numbas- Annuities PV).

\n

$px{a}_{n|}^{p}=loan$

\n

where:

\n\n

Re-arranging the above:

\n

$x={loan \\over p{a}_{n|}^{p}}$

\n

In the above question, working out ${a}_{n|}^{p}$ with an effective interest rate of {interest}% and substituting in loan=£{value} and $p$={p} will give the value of each payment.

\n\n

$i$*OB of previous year

\n\n

Annual payment - interest component

\n\n

OB of previous year - repayment component of current year

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

What is the value (to two decimal places) of each payment?

", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": "2", "maxValue": "{repayment}", "minValue": "{repayment}", "variableReplacementStrategy": "originalfirst", "strictPrecision": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": "50", "scripts": {}, "marks": "5", "type": "numberentry", "showPrecisionHint": false}, {"scripts": {}, "precisionType": "dp", "numColumns": "5", "prompt": "

Create a table in Excel presenting a loan schedule showing the interest and repayment component of every payment and the outstanding balance. Each entry should be to two decimal places.

\n

(Let the first column be the year, second column annual payment, third column interest component, fourth column repayment component and the fifth column outstanding balance. Alter the number of rows by changing the number next to rows).

\n

Click on the button below for hints on Excel functions.

\n

\n
\n\n
", "variableReplacementStrategy": "originalfirst", "type": "matrix", "precisionMessage": "

You have not given your answer to two decimal places.

", "allowFractions": false, "variableReplacements": [], "precision": "2", "markPerCell": true, "numRows": "1", "strictPrecision": false, "tolerance": 0, "showCorrectAnswer": true, "correctAnswer": "sheet", "precisionPartialCredit": "50", "correctAnswerFractions": false, "marks": "20", "allowResize": true}], "statement": "

A {n} year loan of £{value} is to be repaid in annual installments at the end of each year. Assume an interest rate of {interest}%.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"balance": {"definition": "balances(an,intdec,n,p,value)", "templateType": "anything", "group": "Ungrouped variables", "name": "balance", "description": ""}, "sheet": {"definition": "matrix(balance[1..n+1])", "templateType": "anything", "group": "Ungrouped variables", "name": "sheet", "description": ""}, "repayment": {"definition": "{value}/({p}*{an})", "templateType": "anything", "group": "Ungrouped variables", "name": "repayment", "description": ""}, "value": {"definition": "random(1000..5000#500)", "templateType": "randrange", "group": "Ungrouped variables", "name": "value", "description": ""}, "n": {"definition": "random(4..6#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "n", "description": ""}, "p": {"definition": "1", "templateType": "number", "group": "Ungrouped variables", "name": "p", "description": ""}, "interest": {"definition": "5", "templateType": "number", "group": "Ungrouped variables", "name": "interest", "description": ""}, "v": {"definition": "1/(1+{intdec})", "templateType": "anything", "group": "Ungrouped variables", "name": "v", "description": ""}, "an": {"definition": "(1-({v}^{n}))/{intdec}", "templateType": "anything", "group": "Ungrouped variables", "name": "an", "description": ""}, "intdec": {"definition": "{interest}/100", "templateType": "anything", "group": "Ungrouped variables", "name": "intdec", "description": ""}}, "metadata": {"notes": "", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Habiba Gora", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/494/"}]}]}], "contributors": [{"name": "Habiba Gora", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/494/"}]}