Question: C++ Program Create the point class as shown in the text with. (your last assignment given) Now we will add to Point class additional methods

C++ Program

Create the "point" class as shown in the text with. (your last assignment given)

Now we will add to Point class additional methods and code to test each method completely.

a. Write a method to see if two points are equal. ==

b. Write a method to see if two points are not equal. !=

c. Write a method to add two points ( add the xs and add the ys to get a new point) use + operator. Print two points and results.

d. Write a method to subtract the one point from another. Use - operator. Print results

e. Write a method to output a point with the following format ex. ( 5, 6 ) <<

f. Write a method to determine if one point is further distance from the origin (00) then a second point. Use the > operator for this method. Returns T/F value. Print two points and results.

g. Write a method (less than) for < to check if one pt closer to the origin than the second. Print two points and results.

h. Write a method (greater than or equal) for >= to check if one pt further from the origin than the second. Print two points and results.

Write code to test all methods above, label each test, test each Boolean method for both true and for false results. Show the values being tested and the results of each tested method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!