Question: Write a C++ program that prompts the user for two integer arrays and their size. If the size entered by the user is less than

 Write a C++ program that prompts the user for two integerarrays and their size. If the size entered by the user is

Write a C++ program that prompts the user for two integer arrays and their size. If the size entered by the user is less than or equal to zero, ask the user to input again. Then, the program should have three functions described below: dotProduct(...arguments here...): This function has the 2 integer arrays and their size as arguments (for a total of 3 arguments). Compute and return the dot product of these 2 arrays. You must print the dot product from your mainO function. The dot product can be found by adding the products of each element of the arrays. Do NOT use array brackets when accessing the element values of your arrays in this function (use pointers instead) + Ex. Array 1: [1,2,3,4] and Array 2: [3,3,4,6] + Dot Product= ((13) + (2"3)+ (3 4)+ (4#6): 45 - alternate(...arguments here...): This function also takes 2 integer arrays and their size as arguments (for a total of 3 arguments). Print the elements of both of these arrays by alternating the elements of each array. Use array brackets to access the elements for this function. + Ex. Array 1: [1,2,3,4] and Array 2: [5,6,7,8] + It should print: [1,5,2,6,3,7,4,8] - negatives(...arguments here...): This function takes in 2 integer arrays and their size as arguments (for a total of 3 arguments). Change the value of each array to its additive inverse (its negative). You may choose the way you want to access the + A number, N', is the additive inverse of a number, N, if it satisfies the property: N + N, = o + Ex. Array 1: [-1,2,3,-4] + Your program should change the array values with new values: [1,-2,-3,4] These functions must be called from your mainO function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!