Page 156 - CA_Blue( J )_Class9
P. 156
10. Write an equivalent Java syntax for the following expression:
mathematical expression
−
0052 y 3
.
a=
−
xy
Ans. a = (0.05 – 2 * Math.pow(y, 3)) / (x – y);
11. Write the output: Math.pow(25, 0.5) + Math.ceil(4.2);
Ans. 10.0
12. Write the output: Math.round(14.7) + Math.rint(14.7);
Ans. 30.0
Unsolved Questions
A. Tick ( ) the correct answer.
1. What is the output of Math.pow(Math.sqrt(4),2)?
a. 2.0 b. 4.0
c. 8.0 d. None of these
2. How many arguments can be passed into Math.max()?
a. 1 b. 2
c. 3 d. 4
3. How many arguments can be passed into Math.random()?
a. 0 b. 1
c. 2 d. 3
4. What is the output of Math.max(-3.5,2.3)+math.min(2.4,1.4);?
a. 2.3 b. 1.2
c. 3.7 d. 4
5. Which of the following returns the cube root of a number?
a. Math.pow() b. Math.random()
c. Math.cbrt() d. Math.abs()
6. Which of the following is the return type of Math.round()?
a. boolean b. double
c. int d. Both b and c
7. What will be the output of Math.rint(3.4)?
a. 4.0 b. 3.0
c. 3.4 d. None of these
8. What is the output of System.out.println(Math.max(Math.min(4.5,7.4),5.3));?
a. 7.4 b. 4.5
c. 5.3 d. None of these
9. Name the mathematical function which is used to find cosine of an angle given in radians.
a. Math.cos() b. Math.pow()
c. Math.cosine() d. None of these
10. Which of the given Java expressions represents the following arithmetical expression:
(ab ) 3
+
ab
−
a. ((a + b), 3) / Math.abs(a - b) b. Math.sqrt((a + b), 3) / Math.abs(a - b))
c. Math.sqrt((Math.pow(a + b), 3) / (a - b)) d. Math.sqrt(Math.pow(a + b, 3) / Math.abs(a - b))
154 Touchpad Computer Applications-IX

