// Numbas version: exam_results_page_options {"name": "Numbers IV: Rounding decimals to whole numbers and decimal places", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["whole1", "whole2", "whole3", "wholelist", "two1", "two2", "two3", "twolist"], "name": "Numbers IV: Rounding decimals to whole numbers and decimal places", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "
\n

Steps to follow:

\n

1. Retain the correct number of decimal places (e.g. 3 for thousandths, 0 for whole numbers)
2. If the next decimal place value is 5 or more, increase the value in the last retained decimal place by 1

\n

Example-

\n

134.9 rounded to tens is 130 as the next digit (4) is less than 5

\n

12,690 rounded to thousands is 13,000 as the next digit (6) is 5 or more

\n

15.239 rounded to units is 15 as the next digit (2) is less than 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

{wholelist[0]}=[[0]]

\n

{wholelist[1]}=[[1]]

\n

{wholelist[2]}=[[2]]

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

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

\n

\n
\n

\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

\n
\n

\n

For example:

\n\n

\n
\n

\n

Note we only look at the first decimal place when rounding to whole numbers, the others are irrelevant, that is 123.4998 should still be rounded to 123.  

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "gaps": [{"integerPartialCredit": 0, "integerAnswer": true, "allowFractions": false, "variableReplacements": [], "maxValue": "precround(wholelist[0],0)", "minValue": "precround(wholelist[0],0)", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"integerPartialCredit": 0, "integerAnswer": true, "allowFractions": false, "variableReplacements": [], "maxValue": "precround(wholelist[1],0)", "minValue": "precround(wholelist[1],0)", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"integerPartialCredit": 0, "integerAnswer": true, "allowFractions": false, "variableReplacements": [], "maxValue": "precround(wholelist[2],0)", "minValue": "precround(wholelist[2],0)", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"stepsPenalty": 0, "prompt": "

Round the following decimals to 2 decimal places:

\n

{twolist[0]}=[[0]]

\n

{twolist[1]}=[[1]]

\n

{twolist[2]}=[[2]]

\n

Note: Suppose your answer was 123.4, you need to enter your answer as 123.40 since the question asks for 2 decimal places.

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

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

\n

\n
\n

\n

Since we are told to round to two decimal places we look at the third decimal place to determine if we round up or down. If the third decimal place is a 5 or more then you round up (increase the second decimal place by 1) and discard the digits to the right. If the third decimal place is 4 or less then you round down (leave the second decimal place as it is) and discard the digits to the right.

\n

\n
\n

\n

For example:

\n", "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": "precround(twolist[0],2)", "strictPrecision": true, "minValue": "precround(twolist[0],2)", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "2", "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "maxValue": "precround(twolist[1],2)", "strictPrecision": true, "minValue": "precround(twolist[1],2)", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "2", "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "maxValue": "precround(twolist[2],2)", "strictPrecision": true, "minValue": "precround(twolist[2],2)", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "2", "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "extensions": [], "statement": "

To round decimals to whole numbers, we look at first decimal place and if its 5 or more, we round up or else we round it down by 1.

\n

In the following questions, round the following decimals to the nearest whole number

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"wholelist": {"definition": "shuffle([whole1, whole2, whole3])", "templateType": "anything", "group": "Ungrouped variables", "name": "wholelist", "description": ""}, "whole1": {"definition": "random(2..187)+random(list(0.0..0.4#0.1))+random(list(0.05..0.09#0.01))", "templateType": "anything", "group": "Ungrouped variables", "name": "whole1", "description": ""}, "twolist": {"definition": "shuffle([two1,two2,two3])", "templateType": "anything", "group": "Ungrouped variables", "name": "twolist", "description": ""}, "two1": {"definition": "random(2..187)+random(list(0.0..0.9#0.1))+random(list(0.00..0.04#0.01))+random(list(0.005..0.009#0.001))+random(list(0.0001..0.0009#0.0001))", "templateType": "anything", "group": "Ungrouped variables", "name": "two1", "description": ""}, "two2": {"definition": "random(2..187)+random(list(0.0..0.9#0.1))+random(list(0.05..0.09#0.01))+random(list(0.001..0.004#0.001))+random(list(0.0001..0.0009#0.0001))", "templateType": "anything", "group": "Ungrouped variables", "name": "two2", "description": ""}, "two3": {"definition": "random(2..187)+random(list(0.0..0.9#0.1))+random(list(0.00..0.04#0.01))+0.005+random(list(0.00001..0.00009#0.00001))", "templateType": "anything", "group": "Ungrouped variables", "name": "two3", "description": ""}, "whole3": {"definition": "random(2..187)+0.5", "templateType": "anything", "group": "Ungrouped variables", "name": "whole3", "description": ""}, "whole2": {"definition": "random(2..187)+random(list(0.5..0.9#0.1))+random(list(0.01..0.04#0.01))", "templateType": "anything", "group": "Ungrouped variables", "name": "whole2", "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": "Nasir Firoz Khan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/909/"}]}]}], "contributors": [{"name": "Nasir Firoz Khan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/909/"}]}