please help :(
correct Answer = 20 thanks promise
Answers
Answer:
double x= 6.0
//The Math.ceil() function always rounds a number up to the next largest integer. but ceil( ) does not round negative numbers to larger negative numbers; it rounds them up toward zero.
double y= 15.0
// Math.max finds largest number
//The Java Math rint() method returns a value that is closest to the specified value and is equal to the mathematical integer.
Answer:
x = 6.0
y = 15.0
Math.abs - Returns the absolute value of a double value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned. Special cases:
If the argument is positive zero or negative zero, the result is positive zero.
If the argument is infinite, the result is positive infinity.
If the argument is NaN, the result is NaN.
Params:
a – the argument whose absolute value is to be determined
Returns:
the absolute value of the argument.
Math.ceil - Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer. Special cases:
If the argument value is already equal to a mathematical integer, then the result is the same as the argument.
If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.
If the argument value is less than zero but greater than -1.0, then the result is negative zero.
Note that the value of Math.ceil(x) is exactly the value of -Math.floor(-x).
Params:
a – a value.
Returns:
the smallest (closest to negative infinity) floating-point value that is greater than or equal to the argument and is equal to a mathematical integer.
Math.rint -Returns the double value that is closest in value to the argument and is equal to a mathematical integer. If two double values that are mathematical integers are equally close, the result is the integer value that is even. Special cases:
If the argument value is already equal to a mathematical integer, then the result is the same as the argument.
If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.
Params:
a – a double value.
Returns:
the closest floating-point value to a that is equal to a mathematical integer.
Math.max - Returns the greater of two double values. That is, the result is the argument closer to positive infinity. If the arguments have the same value, the result is that same value. If either value is NaN, then the result is NaN. Unlike the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other negative zero, the result is positive zero.
Params:
a – an argument.
b – another argument.
Returns:
the larger of a and b.