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
Sunk Cost Fallacy
The misconception that one should continue an endeavor because of previously invested resources (time, money, effort) even if current costs outweigh the benefits.
Reductio Ad Absurdum
A logical argument technique where a proposition is disproven by following its implications to an absurd consequence.
Argumentum Ad Hominem
A fallacy in debate that targets a person's character or personal traits in an attempt to discredit their argument, rather than addressing the argument itself.
Market Forces
The various factors, such as supply and demand, that influence the price and availability of goods and services in a market.
Q8: What is a button control? Provide two
Q9: Case-Based Critical Thinking Questions Case 1 -
Q19: If the digits argument is omitted, the
Q23: Every object has attributes and behaviors. Describe
Q26: In the mathematical expression 4 * 3
Q26: Case-Based Critical Thinking Questions Case 1 -
Q29: Some peripheral devices can perform a great
Q32: Data types and classes are not related
Q48: An application allows a user to enter
Q59: Write the assignment statements needed to increment