Examlex
Problems - Correcting Logic and Code Errors
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
Private Sub btnDisplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
' displays a pay rate based on an employee's code
' Full Time employee pay rate is 11.50. Part Time
' employee pay rate for those working more than 30 hours
' is 10.50, otherwise it is 9.50
Dim strEmpCode As String
Dim decPayRate As Integer
strCode = txtEmpCode.Text.Snip
' validate the employee code
If strEmpCode = "FT##" Then
decPayRate = 11.50
ElseIf strEmpCode Like "PT30##" Then
decPayRate = 9.50
Else
decPayRate = 10.50
End If
' display pay rate
lblPayRate.Text = decPayRate.ToString("N2")
End Sub
Yield To Maturity
The total return anticipated on a bond if the bond is held until its maturity date, including all interest payments and the repayment of principal.
Capital Gain Yield
The price appreciation component of a stock's total return, excluding dividends, expressed as a percentage of the initial price of the stock.
Par Value
The face value of a bond or stock, as specified by the issuing company, which does not necessarily reflect its market value.
Coupon Rate
The yearly rate of interest that is paid on a bond, represented as a percentage of the bond's nominal value.
Q8: Write an If...Then...Else statement that assigns a
Q10: Describe two advantages to using arrays to
Q20: Write the code to declare a variable
Q20: The expression Math.Round(287.876, 2) yields a value
Q24: Case-Based Critical Thinking Questions Case 1 -
Q36: Problems - Correcting Logic and Code Errors
Q41: Before you can use an array, you
Q56: A procedure in an application needs to
Q57: What is the Refresh method? Write the
Q568: When you open a database, Access assumes