211: Create a class to represent a mathematical vector with private data members for its components. Define constant objects and constant member functions to perform vector addition, subtraction, and scalar multiplication. Implement getter and setter functions for the vector components
// Create a class to represent a mathematical vector with private data members for // its components. Define constant objects and constant member functions to // perform vector addition, subtraction, and scalar multiplication. Implement // getter and setter functions for the vector components #include < iostream > using namespace std ; class Vector { private : float X ; float Y ; float Z ; public : // constructors Vector () : X ( 0 ), Y ( 0 ), Z ( 0 ) {} Vector ( float x = 0 , float y = 0 , float z = 0 ) : X ( x ), Y ( y ), Z ( z ) {} void printVector ( string x ) const { cout << x << ' ( ' << X << " , " << Y << " , " << Z << ' ) ' << endl ; } // overloaded operators ...