// Numbas version: exam_results_page_options {"name": "Rounding to decimals places", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["w2", "w2a", "w22", "f2", "f2a", "f2b", "dp", "dp1"], "name": "Rounding to decimals places", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "
\n

When rounding a number to a certain number of decimal places it is important to recall:

\n\n

You round the number that is immediately to the right of the digit you are wanting to cut the decimal number at.

\n

For example 12.3456 rounds to 12.35 to two decimal places because the third decimal place is 5, therefore the previous digit, 4, is rounded up to a 5.

\n

For more help, check this video -     

\n

                                                  

\n

\n
", "rulesets": {}, "parts": [{"stepsPenalty": 0, "prompt": "

Round the following decimals to the nearest whole number (0 decimal places):

\n

$\\var{w2}$=[[0]]

\n

$\\var{w2a}$=[[1]]

\n

$\\var{w22}$=[[2]]

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "steps": [{"prompt": "

Look at the digit immediately to the right of the boundary (where you are wanting to cut the number at) 

\n

If it is 5 or more, round up, otherwise round down.

\n

To round to a whole number you look at the first decimal place to determine whether you round up or down. If the first decimal place is a 5 or more then you round up (increase the units column by 1) and discard the decimals. If the first decimal 4 or less then you round down (leave the units column as it is) and discard the decimals.

\n

For example:

\n\n

Note: we only look at the first decimal place when rounding to whole numbers (the others are irrelevant). For example, 123.4998 is still rounded to 123.  

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "gaps": [{"precisionType": "dp", "integerPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "integerAnswer": true, "allowFractions": false, "variableReplacements": [], "maxValue": "w2", "strictPrecision": true, "minValue": "w2", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": 0, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "integerPartialCredit": 0, "precisionMessage": "

You have not given your answer to the correct precision.

", "integerAnswer": true, "allowFractions": false, "variableReplacements": [], "maxValue": "w2a", "strictPrecision": true, "minValue": "w2a", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": 0, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "integerPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "integerAnswer": true, "allowFractions": false, "variableReplacements": [], "maxValue": "w22", "strictPrecision": true, "minValue": "w22", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": 0, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"stepsPenalty": 0, "prompt": "

Round the following decimals to {dp} decimal places:

\n

$\\var{f2}$=[[0]]

\n

$\\var{f2a}$=[[1]]

\n

$\\var{f2b}$=[[2]]

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "steps": [{"prompt": "

Since you are rounding to $\\var{dp}$ decimal places we look at the decimal place to the right of this to determine if we round up or down. If the decimal place to the right is a 5 or more then you round up (increase the decimal place to the left by 1) and discard the digits to the right. If the decimal place to the right is 4 or less then you round down (leave the decimal place to the left as it is) and discard the digits to the right.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "gaps": [{"precisionType": "dp", "precisionMessage": "

You have not given your answer to the correct precision.

", "allowFractions": false, "variableReplacements": [], "maxValue": "f2", "strictPrecision": true, "minValue": "f2", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "{dp}", "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "precisionMessage": "

You have not given your answer to the correct precision.

", "allowFractions": false, "variableReplacements": [], "maxValue": "f2a", "strictPrecision": true, "minValue": "f2a", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "{dp}", "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "maxValue": "f2b", "strictPrecision": true, "minValue": "f2b", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "{dp}", "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "extensions": [], "statement": "

When rounding a number to a certain number of decimal places it is important to recall:

\n\n

In the following questions, round the given decimals to the given number of decimal places.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"f2b": {"definition": "w2+w22+0.00498", "templateType": "anything", "group": "Ungrouped variables", "name": "f2b", "description": ""}, "f2a": {"definition": "w2a+0.00324", "templateType": "anything", "group": "Ungrouped variables", "name": "f2a", "description": ""}, "dp1": {"definition": "dp+1", "templateType": "anything", "group": "Ungrouped variables", "name": "dp1", "description": ""}, "w2a": {"definition": "random(12.08..475.08#0.1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "w2a", "description": ""}, "f2": {"definition": "w2+w2a+0.00563", "templateType": "anything", "group": "Ungrouped variables", "name": "f2", "description": ""}, "w22": {"definition": "random(13.01..858.99#0.02)", "templateType": "randrange", "group": "Ungrouped variables", "name": "w22", "description": ""}, "w2": {"definition": "random(12.01..980.99#0.04)", "templateType": "randrange", "group": "Ungrouped variables", "name": "w2", "description": ""}, "dp": {"definition": "random(1..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "dp", "description": ""}}, "metadata": {"description": "

This exercise will help you round off decimals to given decimal places.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Sarah Turner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/881/"}]}]}], "contributors": [{"name": "Sarah Turner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/881/"}]}