Question: using c++, please help. Task Description: You have been given a very simple program that performs basic operations addition, subtraction, editing) on two randomly generated




Task Description: You have been given a very simple program that performs basic operations addition, subtraction, editing) on two randomly generated integer vectors. All functionality has been included in main, causing code segments to be repeated as well as diminishing the readability Rewrite the program by grouping calculations and related operations into functions. In particular, your program should include the following functions. InitializeVestas: This is a void function that initializes the two vectors by random numbers. Inside this function, the user will be prompted to enter the maximum random number. After the vectors have been populated with random numbers, print the vectors side by side. The parameters are the two arrays and their size. EditVester: This is a void function that allows the user to update a value belonging to either vector. The user specifies the vector he wants to edit the index he wants edit, and finally the updated value. The entire vector must then be printed on the screen. You need to pass the two arrays and their sizes. Calculate Axerage: This is a function that returns the average value in a vector. It returns a double and receives as parameters an array and its size. paint. Vector: A void function that takes a vector as a parameter along with its size, and prints it on the screen a As you introduce each function, replace the code in main() by the appropriate function call. Also keep in mind that for some functions, any changes that occur within the function body must also be visible in main. Finally, some functions can be called within other functions. File Edit Format View Help #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
