Question: In this assignment, you are going to turn in a single cpp file. You are going to complete the following two tasks (unrelated). In this

 In this assignment, you are going to turn in a single

In this assignment, you are going to turn in a single cpp file. You are going to complete the following two tasks (unrelated). In this task, you are going to write a boolean function that determines whether all elements in an array are strictly less than a value. In particular, the function takes inputs an integer point to an array int * a, an integer int n as the array's dimension/size, and an integer int K. The function returns true if all elements of the array are strictly less than K, and otherwise false. In this task, you are going to write a function that computes inner product of two vectors (represented by arrays). In particular, the function takes four inputs: int * a, int n, int * b, int m, and the function returns an integer which is supposed to be their inner product. Here a is a pointer to the first array (vector), and n is its dimension: b is another pointer to the second array (vector), and m is its dimension. Here you need to consider the case where n and m do not match. In this case, the inner product is not well-defined, and the function should print "dimension error" on screen and return any arbitrary value. For those who don't know inner products, look at "http: //en.wikipedia.org/wiki/Dot_product

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To complete the given tasks in the assignment you will need to write a single C file with two functions Heres how you can approach each task Task 1 Fu... View full answer

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!