Question: language: c++ 54m ft Lang We are going to write a program to perform arithmetic on vectors, specifically to add and subtract them. We will

language: c++  language: c++ 54m ft Lang We are going to write a
program to perform arithmetic on vectors, specifically to add and subtract them.

54m ft Lang We are going to write a program to perform arithmetic on vectors, specifically to add and subtract them. We will store a vector using an integer array 8 9 10 11 ALL Function Description You have to write the following functions. 12 13 14 15 16 17 print_vector, prints the contents of the vector passed to it. input_vector populates the vector passed to it with values input form the console. add_vectors, takes 3 vectors as parameters and stores the sum of the first 2 vectors in the third one subtract_vectors. takes vectors as parameters and stores the difference of the first 2 vectors in the third one compare_vectors, takes 2 vectors as parameters and returns true if they are equal and false otherwise. 18 19 20 21 N 22 23 3 24 25 26 27 28 29 30 31 v 32 33 34 You may pass any additional parameters to your functions as needed. Input Format For Custom Testing The first line contains an integer, n, denoting the dimension of the 2 vectors that follow. The next line contains n space separated integers which represent the first vector. The next line contains n space separated integers which represent the second vector. The next line contains a single character which is one of: + - - Depending on the character, you have to output the sum or the difference of the vectors or if the vectors are equal. 35 36 37 38 39 Test R 12 54 La left 20 9 10 11 12 ALL 13 14 15 16 You may pass any additional parameters to your functions as needed. Input Format For Custom Testing The first line contains an integer, n, denoting the dimension of the 2 vectors that follow. The next line contains n space separated integers which represent the first vector. The next line contains n space separated integers which represent the second vector. The next line contains a single character which is one of: + ... Depending on the character, you have to output the sum or the difference of the vectors or if the vectors are equal. Sample Case o Sample Input For Custom Testing 17 > > 3 6 5 4 1 2 3 Sample Output 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 7 7 7 Explanation The sum of the vectors [6 5 4] and [1 2 3]" is [77 7 Sample Case 1 Test RE Type here to search RI

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!