Write a menu-driven program that will allow the user to run any of the following questions. Please put the functions headers in .h file and the functions definitions in a SRR file. 1. Write C++ code for a loop that simultaneously computes both the maximum and minimum element in a given vector. 2. Write a function double scalar_product(vector a, vector b) that computes the scalar product of two vectors. The scalar product of two vectors A(al, a2, a3) and B(b1, b2, b3} is another vector C given by C{c1, c2, c3) where cl = al b1, c2a2b2, c3 = a3 + b3. 3. Write a function that computes the alternating sum of all elements in a vector. For example, if alternatingSum() is called with a vector containing 149 16 9 7 4 9 11 then it computes 1-4+9-16+9-7+4-9+11=-2 4. Write a procedure reverse that reverses the sequence of elements in a vector. For example, if reverse is called with a vector containing 149 16 9 7 4 9 11 then the vector is changed 11 9 4 7 9 16 9 4 1 5. Write a function vector append(vector a, vector b) That appends one vector after another. For example, if a is 149 16 and bis then append returns the vector 9749 11 149 16 9 7 4 9 11 6. Write a function vector merge(vector a, vector b) that merges two arrays, alternating elements from both arrays. If one array is shorter than the other, then alternate as long as you can and then append the remaining elements from the longer array. For example, if vector a is
Write a menu-driven program that will allow the user to run any of the following questions. Please put the functions headers in .h file and the functions definitions in a SRR file. 1. Write C++ code for a loop that simultaneously computes both the maximum and minimum element in a given vector. 2. Write a function double scalar_product(vector a, vector b) that computes the scalar product of two vectors. The scalar product of two vectors A(al, a2, a3) and B(b1, b2, b3} is another vector C given by C{c1, c2, c3) where cl = al b1, c2a2b2, c3 = a3 + b3. 3. Write a function that computes the alternating sum of all elements in a vector. For example, if alternatingSum() is called with a vector containing 149 16 9 7 4 9 11 then it computes 1-4+9-16+9-7+4-9+11=-2 4. Write a procedure reverse that reverses the sequence of elements in a vector. For example, if reverse is called with a vector containing 149 16 9 7 4 9 11 then the vector is changed 11 9 4 7 9 16 9 4 1 5. Write a function vector append(vector a, vector b) That appends one vector after another. For example, if a is 149 16 and bis then append returns the vector 9749 11 149 16 9 7 4 9 11 6. Write a function vector merge(vector a, vector b) that merges two arrays, alternating elements from both arrays. If one array is shorter than the other, then alternate as long as you can and then append the remaining elements from the longer array. For example, if vector a is
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.1: Function And Parameter Declarations
Problem 11E
Related questions
Question
100%
These to two screenshots are ONE SINGLE assignment. If you cannot complete this assignment in full, do not answer this question.
If, however, you do plan on building a program using C++ based on the instructions from these two screenshots, then please continue. Thank you for your understanding.
When you are done, join all your programs together and present the user with a menu so they can select which one they want to run.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 12 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr