Question:You work as an application developer at Certkiller .com. Certkiller .com uses an application that
calculates
monthly payments based upon client input.
You are currently debugging this application using the Microsoft Visual Studio 2005 IDE.
The application contains the following code:
Public Function CalculateMonthlyPayment(rate As [Single], principal As Double) As Double
'Implementation code
End Function
You have discovered that unexpected results are being returned by the application. You would
like to pause
execution and display a message box containing an error message in the event of a negative or
zero rate
value is Passed to the CalculateMonthlyPayment method.
You need to ensure that this only occurs during debugging mode.
What should you do? - (VB.Net) 

A Add the following code to the beginning of the CalculateMonthlyPayment method:
Debug.Assert(rate > 0, "Rate Error", "Rate must be > zero") 

B Add the following code to the beginning of the CalculateMonthlyPayment method:
If rate <= 0 Then
MessageBox.Show("Rate is" & rate, [Error])
End If 

C Add the following code to the beginning of the CalculateMonthlyPayment method:
If rate <= 0 Then
Debug.WriteLine("Error Rate is" & rate)
End If 

D Add the following code to the beginning of the CalculateMonthlyPayment method:
Debug.WriteLineIf(rate <= 0, "Error Rate is" And rate) 

+ Answer
+ Report
Total Preview: 909

Copyright © 2024. Powered by Intellect Software Ltd