Explore BrainMass
Share

Creating C++ Program Functions: Recursive Functions

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

(1) Write a recursive function to generate a patter such as the following pattern:

*
**
***
****
****
***
**
*

The program should prompt the user to enter the number of lines in the pattern. Enter 4 should generate the above pattern.

(2) Write a recursive function to generate a patter such as the following pattern:

*
* *
* * *
* * * *
* * *
* *
*

The program should prompt the user to enter the number of lines in the pattern. Enter 4 should generate the above pattern.

(3) A palindrome is a string that reads the same both forward and backward. Write a program that uses a recursive function to check whether a string is a palindrom or not. Your program must contain a value returning recursive function that return true if the string is a palindrome and false otherwise. Do not use any global variables; use the appropriate parameters.

© BrainMass Inc. brainmass.com March 21, 2019, 10:08 pm ad1c9bdddf
https://brainmass.com/computer-science/cpp/c-plus-plus-program-functions-recursive-functions-405917

Solution Summary

Provides steps necessary to create the C++ programs.

$2.19