1. A point in the x-y plane is représented by its x-coordinate and y- coordinate, Design the class Polnt that can store and process a point in the x-y plane. - We should then perform operations on a...


Java


1. A point in the x-y plane is représented by its x-coordinate and y-<br>coordinate, Design the class Polnt that can store and process a point in the<br>x-y plane.<br>- We should then perform operations on a point, such as showing the point,<br>setting the coordinates of the point, printing the coordinates of the point,<br>returning the x-coordinate, and returning the y-coordinate.<br>- Write a test program to test various operations on a point.<br>The class Point should contain the following methods and data members:<br>1. protected members x and y<br>2. default constructor<br>3. constructor with parameters<br>4. setPoint(x)<br>5. getX()<br>6. gety()<br>7. toString( )<br>8. equals(x)<br>9. makeCopy(x)<br>10. getCopy( )<br>| 11. printPoint( )<br>The output should show the following:<br>- Initialize myPoint = [5.00,4.00]<br>Initialize yourPoint = [0.00, 0,00]<br>- Print both of these objects<br>Set yourPoint to [5.00, 45.00] and print it<br>Determine if the 2 points are equal or not<br>Change the myPoint coordinates to (6.00, 9.00]<br>Print this new myPoint object<br>Copy myPoint into yourPoint and then print the<br>yourPoint object<br>

Extracted text: 1. A point in the x-y plane is représented by its x-coordinate and y- coordinate, Design the class Polnt that can store and process a point in the x-y plane. - We should then perform operations on a point, such as showing the point, setting the coordinates of the point, printing the coordinates of the point, returning the x-coordinate, and returning the y-coordinate. - Write a test program to test various operations on a point. The class Point should contain the following methods and data members: 1. protected members x and y 2. default constructor 3. constructor with parameters 4. setPoint(x) 5. getX() 6. gety() 7. toString( ) 8. equals(x) 9. makeCopy(x) 10. getCopy( ) | 11. printPoint( ) The output should show the following: - Initialize myPoint = [5.00,4.00] Initialize yourPoint = [0.00, 0,00] - Print both of these objects Set yourPoint to [5.00, 45.00] and print it Determine if the 2 points are equal or not Change the myPoint coordinates to (6.00, 9.00] Print this new myPoint object Copy myPoint into yourPoint and then print the yourPoint object

Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here