Question: 3. Write a program that creates a Random object with seed 1000 and displays the first 50 random integers between 0 and 100 using the

3. Write a program that creates a Random object with seed 1000 and displays the first 50 random integers between 0 and 100 using the nextInt(100) method. Hint: For this question, you need to look at the Java 15 API and search for Random class and browse its constructors and methods. 4. Design and implement a class named MyPoint to represent a point with X- and y-coordinates. The class contains: The private double data fields x and y that represent the coordinates with getter methods. A no-arg constructor that creates a point (0,0). A constructor that constructs a point with specified coordinates. A method named distance that returns the distance from this point to a specified point of the MyPoint type. A method named distance that returns the distance from this point to another point with specified x- and y- coordinates. A static method named distance that returns the distance from one point with specified x- and y-coordinates (e.g. (xl, yl)) to another point with specified x- and y-coordinates (e.g. (x2, y2)). Write a test program that creates the two point objects with (0,0) and (10, 30.5) coordinates and displays the distance between them
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
