0% found this document useful (0 votes)
71 views

Java Math

The document discusses Java math methods. It provides examples of getting user input of two numbers and outputting the maximum, minimum, and square root of the sum. It also provides questions and answers about the syntax for various Java math methods, including Math.max() to find the maximum value, Math.min() to find the minimum value, Math.sqrt() to find the square root, and Math.random() to generate a random number.

Uploaded by

carren salen
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Java Math

The document discusses Java math methods. It provides examples of getting user input of two numbers and outputting the maximum, minimum, and square root of the sum. It also provides questions and answers about the syntax for various Java math methods, including Math.max() to find the maximum value, Math.min() to find the minimum value, Math.sqrt() to find the square root, and Math.random() to generate a random number.

Uploaded by

carren salen
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

JAVA MATH

1. MAX
2. MIN
3. SQRT
4. ABS
5. RANDOM
JAVA MATH
Create a program that will get 2 numbers
from the user them print the max and
min number them compute and print the
squareroot of the sum of the 2 numbers
Sample output
Input two number
6
3
Max = 6
Min = 3
SQRT = 3
Which is the syntax for method in finding the
higher number?
A. Math.max(x,y);
B. Math.low(x,y);
C. Math.min(x,y);
D. Math.high(x,y);
Which is the syntax for method in finding the
lower number?
A. Math.max(x,y);
B. Math.low(x,y);
C. Math.min(x,y);
D. Math.high(x,y);
Which is the syntax for method in finding the
lower number?
A. Math.sqt(x,y);
B. Math.sqr(x,y);
C. Math.sqrt(x,y);
D. Math.sq(x);
Which is the syntax for method in finding the
ramdom number?
A. Math.random()
B. Math random
C. Math.ran();
D. Math.sq(x);
Activity 10 pts

Create a program that


will function as a
random number picker
from 0 to 10
Math.random()

You might also like