Question
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
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: KAYAK RACECAR ROTOR LEVEL MADAM MOM NOON 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 y. 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 Lab8.cpp this file will contain your main function as well as two other functions. WHAT TO TURN IN Please put Lab8.cpp in a zipped folder and upload to ilearn submission folder.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started