Question: Write a program in c++ to calculates the dot product of two vectors A and B. The main() part of the program: 1. Defines an
Write a program in c++ to calculates the dot product of two vectors A and B. The main() part of the program:
1. Defines an array A and an array B each of which has three elements of data type double that are uninitialized.
2. Queries the user for the vector components Ax, Ay, and Az and then queries the user for vector Bx, By, Bz components.
3. Calls on a function named dotproduct to calculate the dot product of the vectors and returns the value of the dot product of A and B and prints this value to screen.
4. Asks the user if they want to compute another dot product.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
