#include #include #include using namespace std; double dist_2D(double coord0[], double coord1[]); // This assignment is worth 3 points // -1 if nested loops were not used to bring values into array int main() { const int points = 2, dimensions = 2; double input[points][dimensions]; for(int i = 0; i < points; i++) { cout << "Enter coordinate " << i+1 << ": "; for(int j = 0; j < dimensions; j++) { cin >> input[i][j]; } cin.ignore(); } cout << fixed << setprecision(2); cout << "Distance is " << dist_2D(input[0], input[1]) << endl; return 0; } // You can hard code this function for this lab only double dist_2D(double coord0[], double coord1[]) { return sqrt(pow(coord1[0]-coord0[0], 2) + pow(coord1[1]-coord0[1], 2)); }