Programming with Microsoft Visual Basic 2017
8th Edition
ISBN: 9781337102124
Author: Diane Zak
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 5, Problem 5RQ
Program Description Answer
When processing the given code, the string literal “Hi” will appear one time in the lblMsg control.
Hence, the correct answer is option “B”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
How many times will the string literal “Hi” appear in the lblMsg control? Dim intCount As Integer Do While intCount > 4 lblMsg.Text = lblMsg.Text & "Hi" & ControlChars.NewLine intCount += 1 Loop a. zero b. one c. four d. five
How many times will the string literal “Hi” appear in the lblMsg control? For intCount As Integer = 6 To 13 Step 2 lblMsg.Text = lblMsg.Text & "Hi" & ControlChars.NewLine Next intCount a. three b. four c. five d. eight
What will the following code display in the lblSum control? Dim intSum As Integer Dim intY As Integer Do While intY < 3 For intX As Integer = 1 To 4 intSum += intX Next intX intY += 1 Loop lblSum.Text = intSum.ToString a. 5 b. 8 c. 15 d. 30
Chapter 5 Solutions
Programming with Microsoft Visual Basic 2017
Ch. 5 - Rewrite the Loop clause from Question 1 using the...Ch. 5 - Prob. 2MQ3Ch. 5 - Write a For clause that repeats the loop body...Ch. 5 - Write an Add method that adds the contents of the...Ch. 5 - Prob. 2MQ6Ch. 5 - Which of the following clauses will stop the loop...Ch. 5 - Which of the following statements can be used to...Ch. 5 - Prob. 3RQCh. 5 - Prob. 4RQCh. 5 - Prob. 5RQ
Knowledge Booster
Similar questions
- What will the following code display in the lblSum control? Dim intSum As Integer Dim intY As Integer Do While intY < 3 For intX As Integer = 1 To 4 intSum = intSum + intX Next intX intY = intY + 1 Loop lblSum.Text = Convert.ToString(intSum)arrow_forwardA For...Next statement contains the following For clause: For intX As Integer = 5 To -1 Step -2. What value will cause the For...Next loop to stop?a. –1b. –2 c. –3d. none of the abovearrow_forwardIf the str variable contains the string "berry", which pseudocode statement changes itscontents to "blackberry"?a. Set str[0] = "black"b. Set str = str + "black"c. insert(str, 0, "black")d. insert(str, 1, "black")arrow_forward
- What will the following code display in the lblAsterisks control? For intX As Integer = 1 To 2 For intY As Integer = 1 To 3 lblAsterisks.Text = lblAsterisks.Text & "*" Next intY lblAsterisks.Text = lblAsterisks.Text & ControlChars.NewLine Next intX a. *** *** b. *** *** *** c. ** ** ** d. *** *** *** ***arrow_forwardAssume factors pts is the name of an int variable. Convert the Text property of the pointsTextBox control to an int and put the result in the points variable using an if-else expression. An error notice will be displayed if the conversion fails.arrow_forwardWhat will the following code display in the lblSum control?Dim intSum As IntegerDim intY As IntegerDo While intY < 2For intX As Integer = 1 to 3intSum += intXNext intXintY += 1LooplblSum.Text = intSuma. 6b. 9 c. 12d. none of the abovearrow_forward
- What will be the output of the following program when the button is clicked? Private Sub btnDisplay_Click(-) Handles btnDisplay. Click Din number An Double - 3 DoubleAndSquare (number) ExtBox.Text = CStr (number) End Sub Sub DoubleAndSquare (ByRef myVar As Double) myVar = myVar + myvar myVar End Sub Select one: 15. 6 c 18 36arrow_forwardThe items in a combo box belong to which collection? a. Items b. List c. ListBox d. Valuesarrow_forwardIndicate what will be displayed after the following do-while loop has been executed if the user enters the itemPrice as 10.00, 49.99, 37.49, 22.00, 12.49, 10.99. CalculateNumberOfItemsBought noItems = 0 display “Enter the price for the first item” enter itemPrice totalPrice = itemPrice do while totalPrice <= 120 noItems = noItems + 1 display “Enter the price for the next item” enter itemPrice totalPrice = totalPrice + itemPrice loop display “Angela could buy “, noItems, “items” end Select one: a. Angela could buy 3 items b. Angela could buy 4 items c. Angela could buy 5 items d. Angela could buy 6 itemsarrow_forward
- In Visual Basic regarding Loops, how many times will the message display? Ex7) intCounter = 3 Do While intCounter 5 MessageBox.Show(intCounter.ToString & “)”) intCounter += 1 Looparrow_forwardPrint Receipt Button Coding.When the user click on the Print button/menuitem/contextmenuitem, the appwill allow him/her to print out the receiptarrow_forwardIf the user enters the text A34 in the txtNum control, what will theInteger.TryParse(txtNum.Text, intNum) statement assign to the intNum variable? a. A b. A34 c. 0 d. 34arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage