// 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": "
For more help, check this video -
\n\n\n
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\nTo 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\nFor example:
\nNote 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]]
\nNote: 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\nSince 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\nFor example:
\nTo 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.
\nIn 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/"}]}