Examlex
Problems - Correcting Logic and Code Errors
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
An application allows the user to enter a salary amount. The application should then calculate and display the possible bonuses based on that salary, using bonus rates of 3-6% in increments of .5%.
' displays bonus amounts using rates
' of 3% - 6% in increments of .5%
Dim dblSalary As Decimal
Dim decBonus As Decimal
TryParse(txtSalary.Text, decSalary)
lblBonus.Text = String.Empty
For decRate As Decimal = 0.03 To 0.06 Step 0.5
decBonus = decSalary + decRate
lblBonus.Text = lblBonus.Text & decRate.ToString("P1") & " " & decBonus.ToString("C2") & ControlChars.NewLine
Next decRate
Light Waves
Light waves perceptible by the human eye that enable the sense of vision.
Cost-Effective
An attribute of a process, product, or service that provides good value or return for the amount spent.
Wired Transmission Media
Physical materials like copper cables and optical fibers used to transmit data through electrical or light signals in a network.
Web Server
Computer hardware or software that hosts websites, serving content to users over the web based on their requests.
Q1: Based on the code below, intScores(1, 1)
Q7: The strPhone variable contains a 10-digit phone
Q15: Class D addresses are used for multicasting.
Q21: Describe the basic steps involved in compiling
Q25: The _ operator is evaluated last in
Q45: On a Web form, use the check
Q52: A default button is identified by setting
Q53: Adding increments of a negative number is
Q53: An advantage of using the For Each…Next
Q56: To have a check box control trigger