Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz 05 - Math in Java

Total questions: 10

Worksheet time: 50mins

Name
Class
Date
1.

Which symbols is used to find the remainder when dividing two numbers?

a)

*

b)

/

c)

%

d)

#

2.

What is the result of evaluating the expression "29 % 6"?

a)

4

b)

5

c)

1

d)

0

3.

Which is NOT a valid Java expression?

a)

base * height / 2

b)

(base)(height) / 2

c)

(base * height) / 2

d)

base * (height / 2)

4.

What is the result of this Java math expression:

4 + 12 / 5

a)

6

b)

3

c)

6.4

d)

3.2

5.

Which Math class method can be used to calculate square roots?

a)

Math.sqrt()

b)

Math.root()

c)

Math.squareroot()

d)

Math.squirt()

6.

Which Math class method can be used to calculate exponents?

a)

Math.exponent()

b)

Math.raise()

c)

Math.pow()

d)

Math.ceil()

7.

Which Math class method will round any number down (towards negative infinity)?

a)

Math.round()

b)

Math.floor()

c)

Math.ceil()

d)

Math.roundDown()

8.

You want to divide "total" by 5 and get a decimal number. Which of the following will NOT work correctly?

a)

double each = total / 5;

b)

double each = (double) total / 5;

c)

double each = total / (double) 5;

d)

double each = total / 5.0;

9.

Java does NOT follow BEDMAS

a)

True

b)

False

10.

When you try to square root a negative number in Java, what happens?

a)

It returns the value NaN

b)

It raises an error

c)

It returns the value undefined

d)

It returns an imaginary number