Examlex

Solved

The Following Sample of Code Contains Errors

question 27

Essay

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


Definitions:

Lawrence Kohlberg

An esteemed psychologist from the US, widely acclaimed for his foundational theory on the different stages of moral growth.

Western Values

A term often used to describe the set of cultural, ethical, and philosophical principles that are commonly held or valued in Western societies, including democracy, individual rights, and freedom of expression.

Moral Stages

Refers to the levels of moral development that individuals progress through, often conceptualized in the framework of theories such as Kohlberg's.

Related Questions