Question: Write an application that tests whether the examples of the Math class method calls shown in Fig. 5.2 actually produce the indicated results. Fig. 5.2

Write an application that tests whether the examples of the Math class method calls shown in Fig. 5.2 actually produce the indicated results.

Fig. 5.2

Method abs (x) ceil(x) cos(x) exp(x) floor (x) log(x) max (x, y) min(x, y) pow (x, y) sin(x) sqrt (x) tan (x)

Method abs (x) ceil(x) cos(x) exp(x) floor (x) log(x) max (x, y) min(x, y) pow (x, y) sin(x) sqrt (x) tan (x) Description absolute value of x rounds x to the smallest integer not less than x trigonometric cosine of x (x in radians) exponential method et rounds x to the largest integer not greater than x natural logarithm of x (base e) larger value of x and y smaller value of x and y x raised to the power y (i.e., x) trigonometric sine of x (x in radians) square root of x trigonometric tangent of x (x in radians) Example abs (23.7) is 23.7 abs (0.0) is 0.0 abs (-23.7) is 23.7 ceil(9.2) is 10.0 ceil(-9.8) is -9.0 cos (0.0) is 1.0 exp (1.0) is 2.71828 exp(2.0) is 7.38906 floor (9.2) is 9.0 floor (-9.8) is -10.0 log(Math.E) is 1.0 log(Math.E* Math.E) is 2.0 max (2.3, 12.7) is 12.7 max (-2.3, -12.7) is -2.3 min (2.3, 12.7) is 2.3 min(-2.3, -12.7) is -12.7 pow (2.0, 7.0) is 128.0 pow (9.0, 0.5) is 3.0 sin (0.0) is 0.0 sqrt(900.0) is 30.0 tan (0.0) is 0.0

Step by Step Solution

3.45 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To verify the results shown in Fig 52 for the Math class method calls we can write a simple application in Java as thats the typical language associat... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java How To Program Late Objects Questions!