Question

Show the contents of the label, lblOut, after the following Procedure is called:    Sub PrintStuff()        ...

  1. Show the contents of the label, lblOut, after the following Procedure is called:

   Sub PrintStuff()

        Dim intVal As Integer = 0

        Dim strOut As String = String.Empty

Do While intVal < 13

If intVal = 8 Then
strOut = strOut & "k."
ElseIf intVal = 9 Then
strOut = strOut & " St"
ElseIf intVal = 6 Then
strOut = strOut & "Br"
ElseIf intVal = 1 Then
strOut = strOut & " gr"
ElseIf intVal = 10 Then
strOut = strOut & "ay H"
ElseIf intVal = 3 Then
strOut = strOut & "t "
ElseIf intVal = 4 Then
strOut = strOut & "Spr"
ElseIf intVal = 0 Then
strOut = strOut & "Have a"
ElseIf intVal = 5 Then
strOut = strOut & "ing "
ElseIf intVal = 12 Then
strOut = strOut & "lthy!!"
Else
strOut = strOut & "ea"
End If

intVal = intVal + 1

Loop

lblOut.Text = strOut  

End Sub

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per requirement submitted above kindly find below solution.

Question :

Output:Have a great Spring Break.Stay Healthy!!

Demonstration :

Here new windows forms application in VB is created using visual studio 2019 with name "WindowsApp8". This application contains a form with name "Form1.vb".Below is the details of this form.

Form1.vb[Design] :

. Form1 - 0 x Call PrintStuff

*********************

Form1.vb :

Public Class Form1 'VB class
'Button Call PrintStuff() click event
Private Sub btnCall_Click(sender As Object, e As EventArgs) Handles btnCall.Click
PrintStuff()
End Sub
'procedure PrintStuff()
Sub PrintStuff()
'declaring variable of Integer type
Dim intVal As Integer = 0
'declaring variable to store output string of string type
Dim strOut As String = String.Empty
'using Do While loop
'Do While will execute till intVal less than 13
Do While intVal < 13
'checking value of intVal
If intVal = 8 Then
strOut = strOut & "k."
ElseIf intVal = 9 Then
strOut = strOut & " St"
ElseIf intVal = 6 Then
strOut = strOut & "Br"
ElseIf intVal = 1 Then
strOut = strOut & " gr"
ElseIf intVal = 10 Then
strOut = strOut & "ay H"
ElseIf intVal = 3 Then
strOut = strOut & "t "
ElseIf intVal = 4 Then
strOut = strOut & "Spr"
ElseIf intVal = 0 Then
strOut = strOut & "Have a"
ElseIf intVal = 5 Then
strOut = strOut & "ing "
ElseIf intVal = 12 Then
strOut = strOut & "lthy!!"
Else
strOut = strOut & "ea"
End If
intVal = intVal + 1 'increment value of intVal
Loop
lblOut.Text = strOut 'display output on the label
End Sub
End Class

==================================

Output :Run application using F5 and will get the screen as shown below

Screen 1:Screen when button Call PrintStuff() is clicked.

NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
Show the contents of the label, lblOut, after the following Procedure is called:    Sub PrintStuff()        ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • What will be displayed when the sub procedure that follows is run, true or false? Show...

    What will be displayed when the sub procedure that follows is run, true or false? Show all the steps. Option Explicit Sub test() Dim x As Double, z As Double, a As String, b As String x = 7 z = 6 a = "b" b = "a" If Not z > 4 * Atn(1) Or rrr(x) < z Or x > 7 And a > b Then     MsgBox "true" Else     MsgBox "false" End If End Sub Function...

  • Question 21 pts If StudentData.txt file looks like this: 101,70 132,75 153,80 If a sub called...

    Question 21 pts If StudentData.txt file looks like this: 101,70 132,75 153,80 If a sub called student looks like this: Sub Student() Dim StudentID As Integer Dim Score As Integer FileOpen(1, “StudentData.txt”, OpenMode.Input) Do Until EOF(1)     Input(1, StudentID)     Input(1, Score)    MsgBox (Score) Loop FileClose(1) End Sub What will be the display if Sub Student executes? 70 There will be three messages: 70; 75; 80 There will be three messages: 101; 142; 153 none of the above (using...

  • Determine the output displayed when the button is clicked on. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Dim...

    Determine the output displayed when the button is clicked on. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Dim total As Double = 0 Dim num As Integer = 1 Do While num < 5 total += num num += 1 Loop txtOutput.Text = CStr(total) End Sub

  • The Murach's Visual Basic 2015 Book And Visual Studio Exercise 7-2 Enhance the Invoice Total application...

    The Murach's Visual Basic 2015 Book And Visual Studio Exercise 7-2 Enhance the Invoice Total application If you did exercise 6-1 in the last chapter, this exercise asks you to add data validation and exception handling to it. 1. Copy the Invoice Total application from your C:\VB 2015\Chapter 06 directory to your Chapter 07 directory. This should be your solution to exercise 6-1 of the last chapter. 2. If your application has both a Sub procedure and a Function procedure...

  • Project 2 – Memory Match Game Purpose This Windows Classic Desktop application plays a simple matching game. The game si...

    Project 2 – Memory Match Game Purpose This Windows Classic Desktop application plays a simple matching game. The game simulates a card game where the cards a placed face down and the player flips over pairs of cards in an attempt to find matching cards.   Program Procedure Display a 4x4 grid of “face down” cards. Assign the letters A through H randomly to the cards in pairs. Allow the user to click on a card to “flip” it over and...

  • Zander Inc. stores employee IDs and salaries in a sequential access file named Employees.txt. Open the...

    Zander Inc. stores employee IDs and salaries in a sequential access file named Employees.txt. Open the VB2015\Chap10\Zander Solution\Zander Solution (Zander Solution.sln) file. Open the Employees.txt file, which is contained in the project’s bin\Debug folder. The ID and salary information appear on separate lines in the file. Close the Employees.txt window. a. Define a structure named Employee. The structure should contain two member variables: a String variable to store the ID and a Double variable to store the salary. b. Declare...

  • Visual Basic 2015: Extra 18-1 Use inheritance with the Inventory Maintenance Application Source Code: 1. frmNewItem.vb...

    Visual Basic 2015: Extra 18-1 Use inheritance with the Inventory Maintenance Application Source Code: 1. frmNewItem.vb Public Class frmNewItem Public InvItem As InvItem Private Sub frmNewItem_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.LoadComboBox() End Sub Private Sub LoadComboBox() cboSizeOrManufacturer.Items.Clear() If rdoPlant.Checked Then cboSizeOrManufacturer.Items.Add("1 gallon") cboSizeOrManufacturer.Items.Add("5 gallon") cboSizeOrManufacturer.Items.Add("15 gallon") cboSizeOrManufacturer.Items.Add("24-inch box") cboSizeOrManufacturer.Items.Add("36-inch box") Else cboSizeOrManufacturer.Items.Add("Bayer") cboSizeOrManufacturer.Items.Add("Jobe's") cboSizeOrManufacturer.Items.Add("Ortho") cboSizeOrManufacturer.Items.Add("Roundup") cboSizeOrManufacturer.Items.Add("Scotts") End If End Sub Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click If IsValidData() Then InvItem = New InvItem(CInt(txtItemNo.Text),...

  • Prove procedure to compute Fibinocci(n) where F0 = 0, F1 = 1, Fn = Fn-2 +...

    Prove procedure to compute Fibinocci(n) where F0 = 0, F1 = 1, Fn = Fn-2 + Fn-1. Prove by establishing and proving loop invariant then using induction to prove soundness and termination. 1: Procedure Fib(n) 2: i←0,j←1,k←1,m←n 3: while m ≥ 3 do 4:   m←m−3 5:   i←j+k 6:   j←i+k 7:   k←i+j 8: if m = 0 then 9: return i 10: else if m = 1 then 11: return j 12: else 13.   return k

  • Write in Java please. The purpose of this program is to read a file, called WaterData.csv....

    Write in Java please. The purpose of this program is to read a file, called WaterData.csv. It will output date and gallons. So it would look something like "2/04/15 40 Gallons". The pseudo code is as follows. prompt the user for a file name open the file if that file cannot be opened display an error message and quit endif create a String variable 'currentDate' and initialize it to the empty string. create a variable gallonsUsed and initialize it to...

  • computer Programming visual Basic 1-10 QUESTION 1 Which of the following is not a logical operator...

    computer Programming visual Basic 1-10 QUESTION 1 Which of the following is not a logical operator in Visual Basic? Not • or And Then QUESTION 2 Which of the following is a valid Visual Basic conditional statement? 2<n<5 2 <n or <5 0 2 <n<5 (2 <n) or (n <5) QUESTION 3 When Visual Basic stops evaluating a compound condition with the logical And operator because the first condition evaluates to False. It is called evaluation. short-circuit Pre- compound first...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT