Add the following mutator method to the Point class: public void flip() Negates and swaps the x/y
Question:
Add the following mutator method to the Point class:
public void flip()
Negates and swaps the x/y coordinates of the Point object. For example, if an object pt initially represents the point (5, -3), after a call of pt.flip(); the object should represent (3,−5). If the same object initially represents the point (4, 17), after a call to pt.flip(); the object should represent (−17,−4).
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted: