How do I write this function? I can't seem to get it right!
#include <iostream>
#include <cmath>
#include <string>
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;
}