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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Java

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
Transcribed Image 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY