Inside Class Vector 3d Define Standard Constructor Initialising Zero Vector 0 B Overloaded Q43822769
C++
Complete the following program



Inside class vector 3D define (a) a standard constructor initialising a zero vector 0, (b) an overloaded friend unary operator – returning for a vector x as operand the vector y = -x (opposite sign in all compo- nents), (c) an overloaded friend binary operator – returning for two vectors x and ý the difference vector ż= x – y, (d) an overloaded friend binary input operator >> and (e) an overloaded friend binary output operator <<. In function main (f) input vector V2, (g) calculate and assign vz = -V2, output (h) v1, (i) v2, (i) Vz as well as (k) v2 – V3; for each use above defined operators. P07 (2020-01-10) #include<iostream> using namespace std; class Vector3D {private: static const unsigned int dim = 3; double component [dim); public: (a). _operator-( _operator-1 (d) _operator>>( _operator<<( int main(void) {Vector3D v1, v2, v3; cout << “input v2:” << endl; Beispiel input v2: Example 2.3 -2.1 (g) (h) cout << “v1 =” (i) cout << “v2 =” (i) cout << “v3 =” (k)cout << “v2 – v3 = ” return 0; -4.5 3 = 0.1 -2.3 4.5 V2 – V3 = -0 .2 4.6 Show transcribed image text Inside class vector 3D define (a) a standard constructor initialising a zero vector 0, (b) an overloaded friend unary operator – returning for a vector x as operand the vector y = -x (opposite sign in all compo- nents), (c) an overloaded friend binary operator – returning for two vectors x and ý the difference vector ż= x – y, (d) an overloaded friend binary input operator >> and (e) an overloaded friend binary output operator ( _operator
Expert Answer
Answer to Inside class vector 3D define (a) a standard constructor initialising a zero vector 0, (b) an overloaded friend unary op…
OR