Examlex

Solved

A Palindrome Is a Word or Phrase Spelled Which Reads

question 18

Multiple Choice

A palindrome is a word or phrase spelled which reads the same forward or backward. Consider the following code snippet:
Public boolean palindrome(String string)
{
Return isPal(string, 0, string.length() - 1) ;
}
Private boolean isPal(String string, int left, int right)
{
If (left >= right)
{
Return true;
}
Else if (string.charAt(left) == string.charAt(right) )
{
Return isPal(string, left + 1, right - 1) ;
}
Else
{
Return false;
}
}
What does the method palindrome return?


Definitions:

Annuity Stream

A series of fixed payments made at regular intervals, such as monthly or annually, over a specified period or for a lifetime.

Effective Annual Rate

The actual return on an investment or the real rate of interest on a loan, taking into account the effect of compounding over a period.

Amortized Loan

An amortized loan is a loan where the principal is paid down over the life of the loan, typically through equal payments.

Present Value

The equivalent value today of cash flows or a sum of money anticipated in the future, using a predetermined return rate.

Related Questions