Write an If...Then...Else statement that displays the string \"Columbia\" in the
ID: 3817097 • Letter: W
Question
Write an If...Then...Else statement that displays the string "Columbia" in the lblCapital control when the txt State control contains the string "SC" (in any case). 2. Write an lf...Then...Else statement that displays the string "Please enter ZIP code" in the lblMsg control when the txt Zip control does not contain any data. 3. Write an If...Then...Else statement that displays the string "Incorrect quantity" in the IblMsg control when the intQuantity variable contains a number that is less than 0; otherwise, display the string "Valid quantity" 4. Write an If...Then...Else statement that displays the string "Time to reorder" in the IblMsg control when the intInStock variable contains a number that is less than 250; otherwise, display the string "We have enough in stock". 5. Write an lf...Then...EIse statement that assigns the number 35 to the intCommi ssi on variable when the decSales variable contains a number that is less than or equal to $250; otherwise, assign the number 50.Explanation / Answer
1.
If txtState.Text.ToUpper() = "SC" Then
lblCapital.Text = "Columbia"
End if
2.
If txtZip.Text = "" Then
lblMsg.Text = "Please enter ZIP code"
End if
3.
If intQuantity < 0 Then
lblMsg.Text = "Invalid Quantity"
Else
lblMsg.Text = "Valid Quantity"
End if
4.
If intInStock < 250 Then
lblMsg.Text = "Tie to reorder"
Else
lblMsg.Text = "We have enough in stock"
End if
5.
If decSales <= 250 Then
intCommission = 35
Else
intCommission = 50
End if
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.