Design a class named MyPoint to represent a point. The class contains: ➤ Two double private data fields named x and y that specify the coordinates of a point. ➤ A pubic no-arg constructor that creates a default point (0, 0). ➤ A pubic constructor that creates a point with specified x and y coordinates. Two sets of pubic get and set methods for the two private data fields. Write a test class named Lab8 with a main method to create a 2 by 3 array filled with points¹ as follows: (0.5, 1.2) (0.0, 3.14) (6.6, 7.7) (1.2, 2.1) (15.0, 27.5) (12.0, 127.0) In your main method, use a pair of nested for-loops to print the contents of the array. Your output should appear as below:
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Please help me with writing this program. Have to write two different class in which first represent the point and second class is a test program of 2 by 3 array with points. Also help write the UML for this program. Attatching the insturction and display result in the images.
![Create a 2-D array of MyPoint objects.
Design a class named MyPoint to represent a point. The class contains:
Two double private data fields named x and y that specify the coordinates of a
point.
➤ A pubic no-arg constructor that creates a default point (0, 0).
➤ A pubic constructor that creates a point with specified x and y coordinates.
Two sets of pubic get and set methods for the two private data fields.
Write a test class named Lab8 with a main method to create a 2 by 3 array filled with
points¹ as follows:
(0.5, 1.2) (0.0, 3.14) (15.0, 27.5)
|(6.6, 7.7)| (1.2, 2.1)|(12.0, 127.0)
In your main method, use a pair of nested for-loops to print the contents of the array.
Your output should appear as below:
Array[0][0] = (0.5, 1.2)
Array[0][1] = (0.0, 3.14)
Array[0][2] = (15.0, 27.5)
Array[1][0] = (6.6, 7.7)
Array[1][1] = (1.2, 2.1)
Array[1][2] (12.0, 127.0)
=
Requirements: (1) Draw the UML of MyPoint class; (2) implement MyPoint class; (3)
implement Lab8 class with a main method. Save the two program files as MyPoint.java
and Lab8.java.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F34215fe4-737d-4111-858a-1ca99d565feb%2F54acf509-3309-4760-9aef-764f06ac3261%2Ff13hb16_processed.png&w=3840&q=75)
![Note: Your output should look exactly like the output below and should be able to
run test cases.
Array [0][0] = (0.5, 1.2)
Array [0][1]
=
(0.0, 3.14)
Array [0][2]
=
(15.0, 27.5)
Array[1][0] = (6.6, 7.7)
Array [1][1]
=
(1.2, 2.1)
Array[1][2]
=
(12.0, 127.0)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F34215fe4-737d-4111-858a-1ca99d565feb%2F54acf509-3309-4760-9aef-764f06ac3261%2Fa3ig3yb_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)