Writing a c++ program using visual studio
Arrays Lab C++
This lab has several parts, each worth an equal amount of credit. Please put all three parts into one file. Title it (ArrayLab_Rameshwar Shrestha), and comment the code appropriately to distinguish different parts of the lab:
1) Create a function call sumArray which will return the sum of an array that is passed in. Note that a length of the array should also be specified. input: arr={1, 2, 3, 4}, length=3 returns: 6 (because the 4 was ignored because it was past the length)
3) Write a function printAccending, that will take an int array and the length as its input and output each integer on a line that is greater than the last. If one is smaller it will drop to a new line and continue from there: input {2, 5, 8, 3, 9, 9, 7} output: 2, 5, 8 3, 9, 9 7
4) Write a function reverseArrayEven which will loop through a given array (with a size provided as well), and will reverse the digits if they are even numbers. input: {1, 2, 4, 5, 6, 9, 10} returns: {10, 9, 4, 5, 6, 2, 1}
5) Write a function to search a 2-dimentional array for a value. The method should take a reference to a row and col integer, and if the value is found then set the row and col variables accordingly. If the value is not found row and col should both equal -1. Note that lengths of the array should also be taken as input. input: {{1,2,3},{4,5,6},{7,8,9}}, inputRow=3, inputCol=3, foundRow&, foundCol&, searchValue=6 after function completes: foundRow = 1, foundCol=2