Question: I NEED HELP TO WRITE MyVector.h and MyVector.cpp USING THE INSTRUCTION BELOW For this assignment you will add a copy constructor and the following overloaded
I NEED HELP TO WRITE MyVector.h and MyVector.cpp USING THE INSTRUCTION BELOW
For this assignment you will add a copy constructor and the following overloaded operators to your MyVector class:
Here's a description of how each operator should behave:
operator returns true if the length of the left-hand side MyVector is less than the length of the right-hand side MyVector, false otherwise.
operator== : returns true if both MyVectors contain the exact same values, false otherwise.
operator= : overwrites the contents of the left-hand side MyVector with the contents of the right-hand side MyVector.
operator+ : returns a MyVector object that contains an element-by-element sum of the two operators. Consider the following snippet:
MyVector m, n;
cout
If m contains the values 1, 2, 3 and n contains the values 4, 5, then the output would be:
[5, 7, 3].
operator sends a string representation of the MyVector object to the output stream. For example, if the MyVector contains 8 6 7, then operator MyVector m; ... cout You would see [8, 6, 7] on the screen. operator++: post-fix version. increments each element by 1. Returns a MyVector object. operator[]: allows for retrieving and changing elements of the MyVector. AND GIVEN THE main.cpp TO TEST THE PROGRAM. 
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
