Description
WHAT SHOULD THIS PROGRAM DO? (SPECIFICATIONS)
You will implement 5 recursive problems described below and call them from a main function to demonstrate them working.
PROBLEM 1: SUM OF NUMBERS
Write a function that accepts an integer argument and returns the sum of all the integers from 1 up to the number passed as an argument. For example, if 50 is passed as an argument, the function will return the sum of 1, 2, 3, 4, … 50. Use recursion to calculate the sum.
PROBLEM 2: ISMEMBER ARRAY FUNCTION
Write a recursive Boolean function named isMember. The function should accept three arguments: an array, a value, and the size.
The function should return true if the value is found in the array, or false if the value is not found in the array.
PROBLEM 3: STRING REVERSER
Write a recursive function that accepts a string object and the length of the string as its argument and prints the string in reverse order.
PROBLEM 4: PALINDROME DETECTOR
A palindrome is any word, phrase, or sentence that reads the same forward and backward. Here are some well-known palindromes:
Able was I, ere I saw Elba
A man, a plan, a canal, Panama
Desserts, I stressed
Kayak
Write a bool function that uses recursion to determine if a string argument is a palindrome. The function should return true if the argument reads the same forward and backward
PROBLEM 5: RECURSIVE MULTIPLICATION
Write a recursive function that accepts two arguments into the parameters x and y. The function should return the value of x times
-
Remember multiplication can be performed as repeated addition: 7 * 4 = 4+4+4+4+4+4+4
MAIN FUNCTION
This function is written for you except for the function calls!!!
FILES THAT SHOULD BE INCLUDED IN YOUR SUBMISSION
-
Program5.cpp – this file will contain your main function as well as two other functions.
READABILITY OF OUTPUT & CODE DOCUMENTATION
-
Make sure that your output looks similar to my sample output (below). When I run your program, it shouldn’t make me want to scream. It should be extremely readable and user-friendly.
-
For this program, don’t worry about comments except put your NAME at the top of Program5.cpp
WHAT TO TURN IN
Please put program5.cpp in a zipped folder and upload to ilearn submission folder.
SAMPLE OUTPUT