Page 110 - CA_Blue( J )_Class10
P. 110
5. Which type of value is returned by the Math.pow( ) method?
a. int b. double
c. char d. float
6. The Math.sqrt(-4) method returns ………………….
a. 2.0 b. -2.0
c. NaN d. 4.0
7. Which of the following types of value is returned by the Math.max(double, int) method?
a. int b. float
c. double d. None
8. Which of the following is returned by the Math.cbrt(27.0) method?
a. 9.0 b. 3.0
c. -3.0 d. Error
9. The Math.log( ) method works on ………………… numbers only.
a. Negative b. Odd
c. Even d. Positive
10. Which of the following methods will return a value between 0 and 1?
a. Math.pow( ) b. Math.abs( )
c. Math.min( ) d. Math.random( )
11. Which method from the Math class returns the absolute value of an integer?
a. Math.abs() b. Math.absolute()
c. Math.value() d. Math.absValue()
12. What does the Math.floor() method return?
a. The largest integer that is greater than or equal to the argument.
b. The smallest integer that is greater than or equal to the argument.
c. The largest integer that is less than or equal to the argument.
d. The smallest integer that is less than or equal to the argument.
13. Which of the following methods would round a floating-point number to the nearest integer?
a. Math.ceil() b. Math.floor()
c. Math.round() d. Math.intValue()
14. Which method is used to return the trigonometric sine of an angle?
a. Math.sin() b. Math.sine()
c. Math.sineAngle() d. Math.angleSin()
Answers
1. a 2. b 3. c 4. a 5. b 6. c 7. c 8. b 9. d 10. d
11. a 12. d 13. c 14. a
B. Fill in the blanks.
1. ………………… methods can be created by programmers according to the need of the program.
2. The ………………… method is used to find the square root of the provided argument.
3. The Math.abs( ) returns the ………………… value of the given argument.
4. The Math.round( ) method returns the value after rounding it up to the ………………… integer number.
5. The Math.pow( ) method returns the nth power of a number m in the form of ………………… .
6. The Math.round(5) method returns ………………… .
7. The output of Math.ceil() is of ………………… type.
8. The Math.ceil(-53.49) method will return ……………… .
9. The Math.floor(Math.max(4.5,6.8)) method returns ………………… .
10. The Math.pow(Math.sqrt(4),2) method returns ………………… .
108108 Touchpad Computer Applications-X

