Question: LAB EXERCISES: (60 Minutes) Open Recursion 1 Project program then: 1. Add a method named sumEvenNums() in the sumEvenNums C++ file which finds and returns


LAB EXERCISES: (60 Minutes) Open Recursion 1 Project program then: 1. Add a method named sumEvenNums() in the sumEvenNums C++ file which finds and returns the sum of all even integers from 1 to any given number. When you run the program, the output will look like: Enter a non-negative number : 10 The sum of all even numbers from 1 up to 10 is 30 Program ended with exit code: el 2. Add a method named subNums() in the subNums C++ file which finds and returns the difference of all integers from 1 to any given number. For example, if number =5, the result should be (1-2-3-4-5) i.e. -13 When you run the program, the output will look like: Enter a non-negative number: 5 The subtraction of all number from 1 up to 5 is -13 Program ended with exit code: 6 3. Add a method named Array Reverse() in the ArrayReverse C++ file which reverses the elements of an array without using any extra array. When you run the program, the output will look like: How many elements in the array? 5 Enter the elements of array Enter element 1---> 5 Enter element 2---> 6 Enter element 3---> 7 Enter element 4---> 8 Enter element 5---> 9 Array elements before reversing are [5,6,7,8,9,1 Array elements after reversing are (9,8,7,6,5,] Program ended with exit code: 0 4. Add a method named RevIntRecursive() in the RevIntRecursive C++ file which displays an integer number in reverse. When you run the program, the output will look like: What number do you want to reverse the digits of: 12345 >reverseDigits(12345) is 54321 Program ended with exit code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
