Question: Implement the class named CVector see above. The class should contain: [ - ] Two public member variables of type int named x , and

Implement the class named CVector see above. The class should contain:
[-] Two public member variables of type int named x, and y as given.
2
[-] A constructor function with default arguments <0,0>.
[-] Overload the the addition operator as a member function such that it adds
each element of the given vector to the corresponding element of the defined vector.
This operation is identical to simple vector-vector addition:
(u + v)=(ux + vx, uy + vy)
[-] Overload the the subtraction operator as a non-member function such that
it subtracts each element of the other vector from the corresponding element of the
given vector::
(u v)=(ux vx, uy vy)
[-] Overload the the multiplication operator as a member function such that it
multiplies each element of the given vector by the corresponding element of another
given vector:
(u \times v)=(ux vx, uy vy)
[-] Overload the the division operator as a non-member function such that it
divides each element of this vector by the corresponding element of the other vector
(note that element-wise this will be regular integer division that results in integer):
(u/v)=(ux/vx, uy/vy)
[-] See the code above for the examples of vector addition and subtraction, and
also provide examples for the multiplication and the division.
The instructions for the submission of the exercise is gi

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 Programming Questions!