Question: Please do this problem ASAP in C++ code comment 3. Functions with 1-D arrays as parameters Consider a function, named calcDOT that calculates the DOT
Please do this problem ASAP in C++ code comment

3. Functions with 1-D arrays as parameters Consider a function, named calcDOT that calculates the DOT product of two vectors (each represented as a one dimensional array). Recall that the DOT product is the scalar (single value) sum of products of two vectors. That is, for A and B two n-element vectors: 71-1 Dot Product = A.Brazbir =0 The function takes three (3) parameters: n, an int that indicates the length of the vectors, A a one dimensional array of type double B a one dimensional array of type double (assume A and B are of equal length) For example, ilf A is 2 3 4 1 and B is 3 4 5 2, then the dot product is 2*3+3*4+4*5+1*2= 40 a) Write the function calcDOT: b) In main(), statically initialize two 1-D arrays (vectors of type double) named X and Y of length 3 using values of your choice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
