Question: Using C++ Program Objective Write a program that asks the user to enter two vectors and then calculates and displays the dot product of the
Using C++


Program Objective Write a program that asks the user to enter two vectors and then calculates and displays the dot product of the two vectors. Background The dot product of the two vectors(a1, a2, , an) and (b1, b2, , bn) is calculated as (a1, a2, , an) . th,, b2, , bn)-a1b1 + a2b2 + + anbn Note that the two vectors must have the same dimension (length) n in order to calculate their dot product. Program Specifications You program must: Ask the user to enter the dimension (i.e. length) of the vectors. Read the components of each vector into two separate arrays (one array for the first vector and a second array for the second vector). Use a for loop to read in the components of the first vector. Use another for loop to read in the components of the second vector. Use yet another for loop to calculate the dot product Display the dot product of the two vectors. - You may assume that the largest vector dimension that the user will enter is 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
