Examlex

Solved

Would Switching the Special Case Order Affect the Return Value

question 45

Multiple Choice

Would switching the special case order affect the return value of the following method?
Public int mystery(int n, int m)
{
If (n == 0) // special case #1
{
Return 0;
}
If (n == 1) // special case #2
{
Return m;
}
Return m + mystery(n - 1, m) ;
}


Definitions:

Compounded Semi-annually

An interest calculation method where interest is calculated and added to the principal twice a year.

Strip Bond

A financial instrument representing debt, where the main amount and the interest payments have been separated and are traded independently.

Market Rate

The prevailing interest rate available in the marketplace for loans or investments of a similar risk and maturity.

Maturity

The point at which a financial instrument, investment, or policy reaches the end of its term and is due to be repaid or terminated.

Related Questions