Answered step by step
Verified Expert Solution
Question
1 Approved Answer
the code must be in c++ HW6-A: Operations on Arrays You are required to write a code that takes two single-dimensional arrays ( arr1 and
the code must be in c++
HW6-A: Operations on Arrays You are required to write a code that takes two single-dimensional arrays ( arr1 and arr 2 ) of 10 integer values and an integer value X, finds and prints the following: - The dot product of arr1 and arr2. The dot product is an algebraic operation that takes two equal-length single-dimensional arrays of numbers and returns the sum of the products of the corresponding entries in the two arrays. - The that number of times X appears in both arrays. - The largest index of the element in arr2 which has the same value of X. If the element does not exist, then the program prints 1. For example, if the entered arr1 values are: {1,5,6,6,7,5,0,4,6,0} and the arr2 values are: {2,1,2,1,2,1,5,1,2,0} then the dot product =12+51+ 62+61+72+51+05+41+62+00=60. So, in case the value of X equals 1, then the output would be as follows: 6057 IMPORTANT NOTE - Do not add any cout statements such as "Enter the values of arr1" except for the final answers as specified above. - You may add any libraries neededStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started