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

 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). Task 1: 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. Task 2: 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 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!