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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!