0% found this document useful (0 votes)
13 views3 pages

Math Class Mcqs and Java Expresions

I’m not a huge tech fan and I have a lot more respect for people than myself and

Uploaded by

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

Math Class Mcqs and Java Expresions

I’m not a huge tech fan and I have a lot more respect for people than myself and

Uploaded by

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

MATH CLASS MCQ’S + JAVA - EXPRESSION WRITING- 27 MARKS-30 MINS.

Question A [8 X 1= 8 MARKS]

Question 1

Which Java package includes the Math class?

1. java.io
2. java.lang
3. java.util
4. java.sys

Question 2

Give the output of Math.sqrt(x); when x = 9.0

1. 3
2. 3.0
3. 3.00
4. All of these

Question 3

Give the output of Math.ceil(46.6).

1. 46.6
2. 46.5
3. 47.0
4. 46.0

Question 4

Give the output of Math.abs(x); when x = -9.99

1. -9.99
2. 9.99
3. 0.99
4. None of these

Question 5

Which of the following is a method to find the square root of a number?

1. FindSquareroot(x)
2. Sqrt(x)
3. Math.Square(x)
4. Math.sqrt(x)
Question 6

What will be the output of Math.pow(2, 0)?

1. 0.0
2. 1.0
3. 2.0
4. -1.0

Question 7

Math.random() returns a double value r such that

1. 0.0 <= r < 1.0


2. 0.0 <= r <= 1.0
3. 0.0 < r <= 1.0
4. 0.0 < r < 1.0

Question 8

Give the output of Math.floor(46.6)?

1. 46.5
2. 47.0
3. -46.0
4. 46.0

Question B [ 5X 2= 10 MARKS]

Write the following as Java expressions:


Question C [1 X 6 = 6MARKS]

Write valid statements for the following in Java:

i. Print the rounded off value of 234.49

ii. Print the absolute value of -9.99

iii. Print the largest of -45 and -50

iv. Print the smallest of -56 and -57.4

v. Print a random integer between 50 and 70

vi. Print 10.5 raised to the power 3.8

Question D[ 1 X 3= 3 MARKS]

Write the equivalent Java statements for the following, only using
the mathematical functions:

i. Print the positive value of -101.

ii. Store the value -125 in a variable and print its cube root.

iii. Store the value 89.99 in a variable and convert it into its closest
integer that is greater than or equal to 89.99.

You might also like