Define a vector class called vector that stores the magnitude and direction (as an angle) of a
Fantastic news! We've Found the answer you've been seeking!
Question:
Define a vector class calledvectorthat stores themagnitudeanddirection(as an angle) of a vector. The class should have the following:
- Private data members: magnitude and direction both of type double.
- A constructor that takes no arguments.
- An overloaded + operator that is used to add two vectors.
- An overloaded * operator that is used to multiply a scalar (int) times a vector.
- A destructor.
You donotneed to write the code to define the functions, only the definition of the class itself.
View keyboard shortcuts
Posted Date: