Question: Define a vector class called vector that stores the magnitude and direction (as an angle) of a vector. The class should have the following: Private
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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
