Problems: Correcting Logic and Code ErrorsThe following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
Public Class EmployeePrivate _strEmpId As StringPublic _decSalary As DecimalPublic Property EmpId As StringSet(ByVal value As String)_strEmpId = valueEnd SetEnd PropertyPublic Property Salary As DecimalGetReturn _decSalaryEnd GetSet(ByVal value As Decimal)Salary = valueEnd SetEnd PropertyPublic Function New()_strEmpId = String.Empty_decSalary = 0End SubEnd Class

What will be an ideal response?

Public Class Employee
Private _strEmpId As String
Private _decSalary As Decimal

Public Property EmpId As String
Get
Return _strEmpId
End Get
Set(ByVal value As String)
_strEmpId = value
End Set
End Property

Public Property Salary As Decimal
Get
Return _decSalary
End Get
Set(ByVal value As Decimal)
_decSalary = value
End Set
End Property

Public Sub New()
_strEmpId = String.Empty
_decSalary = 0
End Sub
End Class

Computer Science & Information Technology

You might also like to view...

The Bullets button is in the Font group of the Home tab

Indicate whether the statement is true or false

Computer Science & Information Technology

The Rich Text Content Control is a content control that enables the user to enter unformatted text

Indicate whether the statement is true or false

Computer Science & Information Technology