Question: Create a new class named RandomNumber. Write program to generate three double type number within range [0, 100]. Calculate the square root of the sum

Create a new class named RandomNumber. Write program to generate three double type number within range [0, 100]. Calculate the square root of the sum of those three numbers.

(i.e., if a, b and c are three random numbers, the result should be Math.sqrt(a + b + c))

Simulate the sample output:

(Since the numbers generated are random, you may not see the same numbers at each run)

Hint: if rand is defined as Random rand = new Random();

then rand.nextDouble() will generate a double type number within range [0, 1].

rand.nextDouble() * 100 will generate a double type number within range [0, 100].

Submit RandomNumber.java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!