0% found this document useful (0 votes)
8 views2 pages

Math Function Class9 Sample-Paper

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Math Function Class9 Sample-Paper

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ICSE COMPUTER APPLICATION

SAMPLE PAPER
Mathematical Library Methods
A. Tick ( ) the correct option.
1. Which among the following package is imported by default:
a. java.lang b. java.util
c. Both a and b d. None of these
Ans. a. java.lang
2. Which among the following class do not belong to the java.lang package?
a. System b. String
c. Math d. Scanner
Ans. d. Scanner
3. Which among the following function returns the absolute value of a number?
a. Math.absoulute( ) b. Math.neutral( )
c. Math.abs( ) d. Math.positive( )
Ans. c. Math.abs( )
4. Which among the following will yield -1 for negative number and 1 for positive number for a
number stored in a variable a?
a. Math.abs(a)*a b. Math.abs(a) / a
c. Math.ceil(a) / Math.floor(a) d. None of these
Ans. b. Math.abs(a) / a
5. Which among the following gives the next mathematical integer?
a. Math.floor( ) b. Math.ceil( )
c. Math.random( ) d. All of these
Ans. b. Math.ceil( )
6. What is the return type of Math.min(1,2.0f)?
a. float b. double
c. int d. long
Ans. a. float
7. Which among the following expression will return a random integer between 5 and 10 both
inclusive?
a. 5+(int)(Math.random()*6) b. 5+(int)(Math.random()*10)
c. 5+Math.random()*6 d. 5+Math.random()*10
Ans. a. 5+(int)(Math.random()*6)
8. Which among the following function is equivalent to Math.sqrt(a)?
a. Math.cbrt(a); b. Math.pow(a,1/2)
c. Math.pow(a,1/2.0); d. Math.
Ans. c. Math.pow(a,1/2.0);
9. What value will Math.sqrt(-9) return?
a. -3.0 b. 3.0
c. NaN d. None of these
Ans. c. NaN
10. What value will Math.sqrt(Math.ceil(8.1)) return?
a. 9.0 b. 9

c. 3.0 d. 4.0
Ans. c. 3.0

A. Answer the following questions.


1. Name the class that is used for different mathematical functions. Give an example of a
mathematical function.
Ans. class: Math
Functions: Math.pow(), Math.sqrt(), Math.floor(), etc.
2. Give the output of the following expressions.
i. If x = -9.99, calculate Math.abs(x);
ii. If x = 9.0, calculate Math.sqrt(x);
Ans. i. 9.99
ii. 3.0
B. Give the output of the following functions:
1. Math.floor(-126.349)
Ans. -127.0
2. Math.max(45.6,17.3)
Ans. 45.6
3. Math.min(-0.0,0.0)
Ans. -0.0
4. Math.pow(4,3)
Ans. 64.0
5. Math.sqrt(625)
Ans. 25.0
6. Math.cbrt(125)
Ans. 5.0
7. Math.max(11,11)
Ans. 11
8. Math.ceil(-12.56)
Ans. -12.0
9. Math.floor(15.36)
Ans. 15.0

10. Math.round(146.5)
Ans. 147.0

You might also like