Course Solutions Uncategorized (Solved) : Assume Re Provided Vector Class Mathematical Vector Container Vector Additionally Assume Q27689869 . . . .

(Solved) : Assume Re Provided Vector Class Mathematical Vector Container Vector Additionally Assume Q27689869 . . . .

 

Assume you’re provided the vector class that is below(mathematical vector, not container vector). Additionally, assumethat all of the appropriate infrastructure is in place such asconstructors and destructors. Add an overloaded addition (+)operator to the class that is an element-by-element sum of twocomponent vectors. It should only perform the addition if the twovectors are of the same length. Otherwise, it should return anempty vector (length 0). For example:

             Let A = {1,2,3}

             And let B = {4,5,6}

             The A+B = {5, 7, 9}

class vector

{

private:

int * vec; //assume vec is always properly initialized

int len; // if len is zero, then assume vect containsnullptr

public :

// add

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post