1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
Fill in the blank to round up. | let roundedNum = ___________(numWithDecimal); | Math.ceil | Math\.ceil |
What is the value of roundedNum? | let roundedNum = Math.floor(1.9); | 1 | 1 |
Round up origNum and assign it to roundNum, which hasn't been declared beforehand. | let roundNum = Math.ceil(origNum); | letroundNum=Math\.ceil\(origNum\); | |
Round down origNum and assign it to roundNum, which hasn't been declared beforehand. | let roundNum = Math.floor(origNum); | letroundNum=Math\.floor\(origNum\); | |
Round a variable's number to the nearest integer. Assign the result to a second variable that hasn't been declared beforehand. Make up the variable names. | let newNum = Math.round(numWithDecimal); | let[a-z_$][a-zA-Z0-9_$]*=Math.round\([a-z_$][a-zA-Z0-9_$]*\); | |
Round down a variable's number and assign the result to a second variable that hasn't been declared beforehand. Make up the variable names. | let newNum = Math.floor(numWithDecimal); | let[a-z_$][a-zA-Z0-9_$]*=Math\.floor\([a-z_$][a-zA-Z0-9_$]*\); | |
Round up a variable's number and assign the result to a second variable that hasn't been declared beforehand. Make up the variable names. | let newNum = Math.ceil(fractional); | let[a-z_$][a-zA-Z0-9_$]*=Math\.ceil\([a-z_$][a-zA-Z0-9_$]*\); | |
Round .00001 to 1 and assign it to a variable that hasn't been declared beforehand. Make up the variable name. | let num = Math.ceil(.00001); | let[a-z_$][a-zA-Z0-9_$]*=Math\.ceil\(\.00001\); | |
|
|||
|