Which code segment should you use?

You are developing an application for a bank. The application includes a method named
ProcessLoan that processes loan applications. The ProcessLoan() method uses a method
named CalculateInterest. The application includes the following code:

You need to declare a delegate to support the ProcessLoan() method.
Which code segment should you use?

You are developing an application for a bank. The application includes a method named
ProcessLoan that processes loan applications. The ProcessLoan() method uses a method
named CalculateInterest. The application includes the following code:

You need to declare a delegate to support the ProcessLoan() method.
Which code segment should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 8

Your email address will not be published. Required fields are marked *


Frank2504

Frank2504

Where is the following code?

Leonardo

Leonardo

Incomplete question!

Jack

Jack

Answer is C. Used a dump to check.

theAllKnowingGuy

theAllKnowingGuy

why is the answer c correct!!!!!!!!!

j

j

May the Force be with you…. C

Mah

Mah

Code could be like this this:
class Program
{
public delegate decimal CalculateInterest(decimal loanAmount, decimal loanRate, int term);
static void Main()
{

CalculateInterest cal = ProcessLoan;
decimal retvalue = cal.Invoke(12, 1, 2);
Console.WriteLine(retvalue);

CalculateInterest cal2 = new CalculateInterest(ProcessLoan);
Console.WriteLine(cal2.Invoke(12, 1, 2));

}

static public decimal ProcessLoan(decimal loanAmount, decimal loanRate, int term)
{
decimal returnValue = loanRate / loanAmount * term;
return returnValue;
}
}