Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please follow the following method and function and main to solve this problem a

ID: 3938500 • Letter: P

Question

Please follow the following method and function and main to solve this problem and output has to be same please.

Question - Write a recursive function to check if a given string is a palindrome. First complete given function prototype: bool isPal(const string &str;, int start, int end); Then use the provided driver program to test your code. 2- Write a recursive function that returns the frequency of occurrence ofa particular digit 'd' in an integer n, First complete given function prototype: int frequencyCount(int number, int digits); Then use the provided driver program to test your code. Submit a single cpp file le

Explanation / Answer

int frequencyCount(int number,int digits)
{
if(number>0)
{
if(digits==number%10)
{
return frequencyCount(number/10,digits)+1;
}
else
return frequencyCount(number/10,digits);
}
else
return 0;
}

bool isPal(const string &str,int start,int end)
{
if(str[start]==str[end])
{
const string &str1=str;
if(isPal(str,++start,--end))
return true;
}
else
return false;
}