QuestionQuestion

What value is assigned to decTaxes by the following program segment, assuming that the user enters 50000 into the textbox txtSalary.Text?

Dim decSalary, decTaxes As Decimal
decSalary = CDec(txtSalary.Text)
If (decSalary > 50000) Then
    decTaxes = .40 * decSalary
ElseIf (decSalary) > 40000) Then
    decTaxes = .30 * decSalary
ElseIf (decSalary > 30000) Then
    decTaxes = .20 * decSalary
Else
    decTaxes = .10 * decSalary
End If

20000
15000
10000
5000

Suppose you want to verify that the user has entered a value into a text box named txtInput. Which of the following code segments responds with an appropriate message if the user does not enter a value?

If txtInput.Text <> "" Then
    lblStatus.Text = "No data has been entered"
End If

If txtInput.Text <> " " Then
    lblStatus.Text = "No data has been entered"
End If

If txtInput <> String.Empty Then
    lblStatus.Text = "No data has been entered"
End If

If txtInput.Text = String.Empty Then
    lblStatus.Text = "No data has been entered"
End If

What is assigned to lblMessage.Text when the following code segment executes?
Dim strName1 As String = "Jim"
Dim StrName2 As String = "John"
If strName1 > strName2 Then
    lblMessage.Text = "Jim is greater"
Else
    lblMessage.Text = "John is greater"
End If

True
False
Jim is greater
John is greater

Which change would correct the syntax error in the following code?

1: If intScore < 80 Then
2:    strGrade = "C"
3: Else intScore > 80 Then
4:    strGrade = "A"
5: End If

1: If (intScore < 80) Then
2:   Set strGrade = "C"
3: ElseIf intScore > 80 Then
None of these correct the syntax error

What value is assigned to the String variable strSecond when the following code is executes?

Dim strFirst As String
Dim strSecond As String
strFirst = "1 2 Button My Shoe"
strSecond = strFirstName.ToUpper()

"1 2 bUTTON mY sHOE"
"1 2 BUTTON MY SHOE"
"    Button My Shoe"
"12BUTTONMYSHOE"

The expression Single.TryParse("12.5", sngNbr) performs which of the following?

Returns True
Returns False
Places the value 12.5 in the variable sngNbr
Returns True and places the value 12.5 in the variable sngNbr

Which of the following declares an Integer variable named intLength and assigns it the integer literal 12?

Dim intLength As Integer initialize to 12
Dim intLength = 12 As Integer
Dim intLength As Integer = 12
Dim intLength As Integer 12

Which will be displayed in the label lblResult following execution of the code below?

Dim dblGrossPay as Double
dblGrossPay = 3500
lblResult.Text = dblGrossPay.ToString("c")

3500.00
3500
$3500.00
$3,500.00

What will be assigned to the label when the following statements execute?
Dim dblVal As Double = 11.75
lblResult.Text = dblVal.ToString("n3")

$11.75
11.75
11.750
12

Which of the following displays a message box with the text "Hello World"?

MessageBox.Show("Hello World")
MessageBox.Display("Hello World")
MessageBox.Text("Hello World")
MessageBox.Send("Hello World")
What is the value of intE after the following statements execute?

Dim intC As Integer
Dim intD As Integer
Dim intE As Integer
intC = 20
intD = 3
intE = intC \ intD

7
6
6.666667
0

What will be the value of intAnswer after execution of these statements?
Const intNumA As Integer = 6
Const intNumB As Integer = 2
intAnswer = intNumA / intNumB + intNumA * intNumB

12
15
16
18

The expression IsNumeric(13.75) returns the value ________.

True
1375
14
13.75

What value will be assigned to decCommission after the following code executes?
Dim decMonthlySales, decCommRate, decCommission As Decimal
decMonthlySales = 6500.00
Select Case decMonthlySales
    Case Is < 1000
       decCommRate = 0.05
    Case 1000 To 9999.99
       decCommRate = 0.10
    Case Is >= 10000
       decCommRate = 0.15
End Select
decCommission = decCommRate * decMonthlySales

0.00
325.00
650.00
925.00

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

Question 1: The answer is 15000

Question 2: The answer is:
If txtInput.Text = String.Empty Then
    lblStatus.Text = "No data has been entered"
End If...

By purchasing this solution you'll be able to access the following files:
Solution.docx.

$27.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Visual Basic Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats