#include #include #include using namespace std; ////////////////////////////////////////////////////// //Prototypes for readDoubles and dotProduct goes here. ////////////////////////////////////////////////////// double* readDoubles(string filename, int &N); double dotProduct (double *v1, double *v2, int size); int main453454354() { int size1, size2; //read in the two vectors double* v1 = readDoubles("hw25_vector1.txt", size1); cout << "Read vector 1. Size is: " << size1 << endl; double* v2 = readDoubles("hw25_vector2.txt", size2); cout << "Read vector 2. Size is: " << size2 << endl; //calculate dot product double dp = dotProduct(v1, v2, size1); //Output the result cout << "The dot product of Vector1 and Vector2 is: " << dp << endl; return 0; } ////////////////////////////////////////////////////// //Definitons for readDoubles and dotProduct goes here. ////////////////////////////////////////////////////// // Read in array of double froms given filename. // First number in file is the number of doubles double* readDoubles(string name, int &N) { ifstream fin(name.c_str()); // get size fin >> N; // create array double *array = new double[N]; // read in values for (int i=0; i> array[i]; } return array; } // Compute dot product of two given vectors double dotProduct (double *array1, double *array2, int N) { double sum = 0; for (int i=0; i