Question: C++ PROGRAMMING (this isnt a project its just a quick program, much easier than it looks) it is due soon so please help me so

C++ PROGRAMMING (this isnt a project its just a quick program, much easier than it looks) it is due soon so please help me so i can give 5 stars

C++ PROGRAMMING (this isnt a project its just a quick program, much

easier than it looks) it is due soon so please help me

Code Needed:

#include using namespace std; class Vector { public: /* Default constructor, sets x and y to zero */ Vector(); /* Parameterized constructor, sets x to Xval, and y to yVal */ Vector(float xVal, float yVal); /* Returns the floating point values of the x and y */ float getX() const; float getY() const; /* * Inserts into the stream the string "(, )" where * is the floating point value for x * is the floating point value for y */ friend ostream& operator 
#include "Vector.h" #include using namespace std; int main(void) { float x, y; cout > x >> y; Vector v1(x, y); cout > x >> y; Vector v2(x, y); cout   In this project you will implement operator overloading for a two dimensional Vector class. Begin with the declaration of the Vector class on the final page. There are three operators that must be overloaded insertion addition and subtraction insertion The insertion operator is used to send the values of a vector to an ostream object, if a vector has two values 2.0 and 3.1 it must insert into the string "(2.0, 3.1)". For example, code Segment A will produce the Output A Segment A Vector v (2.2, 3.1) cout "Vector v1: v endli output A Vector v1 (2.2, 3.1) addition The addition operator is used to sum two vectors together. Addition is pairwise, x is added to x, and y to y. The result of the operation is a new object that contains the sum of the two Vectors as a si e vector. Code given in Segment B produces the Output B Segment B Vector v1 (2.0 3.1) v2 (4.3 v2 v1 v2 endl. cout v1 output B v1 v2 (6.3, 8.1)

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 Databases Questions!