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
Where is the following code?
Incomplete question!
Answer is C. Used a dump to check.
why is the answer c correct!!!!!!!!!
May the Force be with you…. C
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;
}
}
So it may be A or C. You made the Code around C. Is there any reason it could not be A?
The Code that is missing here can be found here (http://vceguide.com/which-code-segment-should-you-use-57/) after that I’m also for answer C.