Question: (C++ program) Design a class called XY. Design the class to have two private interger members X and Y. - Provide a default constructor. Set
(C++ program)
Design a class called XY. Design the class to have two private interger members X and Y.
- Provide a default constructor. Set both X and Y to be default value 0
- Provide a constructor with parameter. Initialize X and Y to be parameter values.
- Provide a copy constructor.
- Provide set and get member functions.
- Overload the + operator to enable adding of two XY instances. You are supposed to add their X part together and their Y part together.
- Overload the == operators to allow comparisons of two XY instances.
- Enable input and output of XY instance through the overloaded >> and << operators.
- You need to design a class header file, an implementation file and a driver file . The driver file needs to test out each of the member functions completely
(show output and comments)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
