i need help with questions 1,2,6,10,11 please
0 CHAPTER 2 Recursion: The Mirrors 3. Write a recursive function that will compute the sum of the first integers in an array of at least ninte- gers. Hint: Begin with the nth integer. Given two integers, start and end, where end is greater than start, write a recursive C++ function that returns the sum of the integers from start through end, inclusive. 3. Revise the function writebackward, discussed in Section 2.3.1. so that its base case is a string of length b. Write a C++ function that implements the pseudocode function writeBackward, as given in Section 2.3.1. 6. Describe the problem with the following recursive function: void print Num(int n) std::cout 0, write a recursive C++ function that writes the integers 1. 2...... 8. Given an integer > 0, write a recursive C++ function that returns the sum of the squares of through n. 9. Write a recursive C++ function that writes the digits of a positive decimal integer in reverse order. 10. a. Write a recursive C++ function writeLine that writesa character repeatedly to form a line of characters For example, writeLine( 5) produces the line ***** b. Now write a recursive function writeBlock that uses writeLine to write lines of characters each. For example, writeBlock'. 5. 3) produces the output 11. What output does the following program produce! int getValueint aint bint n): int sain() std::endl stdiscout getValue(1, 7. 7) return 0 1 dan int getValue(int a int b. int n) int return value=0 stdout "Enter - stond 17 (6 ) return value -1. n) return value = getValue( std cout Leavet - return return value - * LLLLLLL replace an intuitive understanding of me Recursion allows you to solve problema ch as the Towers of Handwewe Keratin Solutions are difficult to contention. Even the most complex problems often have erworward reuniverso tion. Such slutions can be easier to understand describe and implement than merative solutions Some W e than cotton tondiniterate solution due to the inberently inefficient aloites and the overhead of function calls. Va schy cases, the termine solution can be pro v eo on. Moreove the main w you can easily clearly and elliciently solve a problem by using terutku su wwwdd EXERCISES The following r e action pour marches ihe may finitopers for certamences of the integendeel. Mes the materiales in ihanangul eden revalue. For example in the sen integers) 2.444. 12. 12. then getuwtery returns the value 2. because 4 cars wice Ant gewunderbuat consta HUMOR ter derrede tout CH Demonstrate that this function is renge by listing the recorregung wwelen anat eny Bow the funcion meets each criterio 2. Perform whes trace of the following calls to recarsive Hunctions that appear in the chupe Clearly indi Cate ench subsequent recurs call ) Visa ota oo inches point Oue