// Written by Hosung Leo Kim #include #include int getInput() { int value; cout << "1 or 2? "; cin >> value; return value; } void lineLength() { int x1, y1, x2, y2; cout << "x1 y1 x2 y2? "; cin >> x1 >> y1 >> x2 >> y2; cout << sqrt( pow( ( x2 - x1 ), 2 ) + pow( ( y2 - y1 ), 2 ) ) << endl; return; } int main() { int choice; choice = getInput(); switch ( choice ) { case 1: cout << "You chose 1" << endl; lineLength(); break; case 2: cout << "You chose 2" << endl; } return 0; }