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

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!