Numbers Solution Exercise 5-6 Zak's Programming with Microsoft Visual Basic 2019/2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024
  • Open the Numbers Solution.sln file. The application allows the user to display a list of numbers in a list box. The user will enter the start and end values for these numbers in the two text boxes. (F5.1, F5.2, F5.4, F5.5, F5.6, and F5.7, A5.1, A5.2, and A5.3)
    a. Open the Code Editor window. Locate the btnForNext_Click procedure and then click the blank line above its End Sub clause. Use the For ... Next statement to display the range of numbers indicated by the user. For example, if the user enters the numbers 1 and 5 in the From and To boxes, respectively, the statement should display the numbers 1 through 5 in the list box. Display the numbers only when the value in the From box is less than the value in the To box; otherwise, leave the list box empty. Save the solution and then start and test the procedure.
    b. Now, locate the btnDoPretest_Click procedure and then click the blank line above its End Sub clause. Use a pretest Do ... Loop statement to display the range of numbers indicated by the user. Display the numbers only when the value in the From box is less than the value in the To box; otherwise, leave the list box empty. Save the solution and then start and test the procedure.
    c. Finally, locate the btnDoPosttest_Click procedure and then click the blank line above its End Sub clause. Use a posttest Do ... Loop statement to display the range of numbers indicated by the user. Display the numbers only when the value in the From box is less than the value in the To box; otherwise, leave the list box empty. Save the solution and then start and test the procedure.

ความคิดเห็น • 2

  • @TMS94
    @TMS94 ปีที่แล้ว +1

    Professor can you do chapter 7 exercises. Pages 290 #1 and 291 #7 I partially did them already but I am having trouble.

    • @EricNagel716
      @EricNagel716  ปีที่แล้ว +1

      Hi Tyler sorry but I don't have time to make other videos this semester (beyond what I'm assigning to my class) but for 7-1, "assign the ISBN (without any hyphens) to thestrIsbn variable" you'd use something like Dim thestrIsbn as String = txtIsbn.Text.Replace("-", "")
      "insert a hyphen after the third number, the fourth number, the seventh number, and the twelfth number" you'd use thestrIsbn = thestrIsbn.Insert("-", 3) ... etc.
      For 7-7, your If statement would be
      If txtZip.Text Like "4210[2-4]" Then
      ' Valid stuff
      Else
      ' Invalid stuff
      End If