Question: Lab # 6 Operator Overloading Problem: Write the definition for a class named Vector2D that stores information about a two dimensional vector The class should
Lab # 6 Operator Overloading Problem: Write the definition for a class named Vector2D that stores information about a two dimensional vector The class should have methods to get and set the x component and the y component, where x and y are integers. Next, overload the operator so that it returns the dot product of two vectors. The dot product of two-dimentional vectors A and B is equal to (Ar Br)+(Ay By Finally, write a main program that tests the three overloaded opcrators (10,0) (0,10)-0 (0,10) *(10,10) 100 (10,10) (5,4) -90 Input Enter two number for vector1 10 0 Enter two number for vector 2 0 10 Enter two number for vector 3 0 10 Enter two number for vector 4 10 10 Enter two number for vector 5 10 10 Enter two number for vector 6 5 4 Page 1 of 3 Output (10,0) * (0,10) =0 (0,10) * (10,10) = 100 (10,10)(5,490
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
