A friend has a point class that needs some help with its interface. You volunteer to help add operator overloading to the class. (No, really, you did. Don't you remember?) You decide to overload operators for the distance between two points (operator-), input (operator>>), output (operator<<), equality (operator==), and inequality (operator!=). After a bit of arguing, you decide to also overload for midpoint (operator/). You decide to also fix up your frie
Topical Information
Use C++. This lab will help you practice with operator overloading (mixed with classes).
Program Information
A friend has a point class that needs some help with its interface. You volunteer to help add operator overloading to the class. (No, really, you did. Don't you remember?)
You decide to overload operators for the distance between two points (operator-), input (operator>>), output (operator<<), equality (operator==), and inequality (operator!=). After a bit of arguing, you decide to also overload for midpoint (operator/).
You decide to also fix up your friend's class by adding operator= and 'missing' constructors.
Don't forget to write a small test application to show that the class still works -- new operators and all!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps