Question: How do I write this function? I cant seem to get it right! #include #include #include using namespace std; struct Point { double x; double

How do I write this function? I cant seem to get it right!

#include

#include

#include

using namespace std;

struct Point {

double x;

double y;

};

//Do not modify anything on or above the line below this

//YOUR_CODE_BELOW

Point midPoint(const Point& a, const Point& b)

{

//IN HERE

}

//YOUR_CODE_ABOVE

//Do not modify anything on or below the line above this

int main()

{

Point p1;

cin >> p1.x;

cin >> p1.y;

Point p2;

cin >> p2.x;

cin >> p2.y;

Point p3 = midPoint(p1, p2);

cout << "(" << p3.x << ", " << p3.y << ")" << endl;

return 0;

}

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!