#include #if 0 using namespace std; struct point { double x; double y; }; // Returns midpoint of two given points point calcMidpoint (point p1, point p2); // read point from cin point readPoint(); int main() { point p1, p2, p3; cout << "Please enter a point like 4.3 5.4: "; //cin >> p1; ERROR! cin >> p1.x; cin >> p1.y; cout << "Please enter another point like 4.3 5.4: "; //cin >> p1; ERROR! cin >> p2.x; cin >> p2.y; p3 = calcMidpoint(p1, p2); cout << "The midpoint was " << p3.x << " " << p3.y << endl; return 0; } point calcMidpoint (point p1, point p2) { point newpt; newpt.x = (p1.x + p2.x) / 2; newpt.y = (p1.y + p2.y) / 2; return newpt; } #endif