CIS3309: Component-Based Software Development

CIS3309: Component-Based Software Development

<p> CIS3309: Component-Based Software Development Spring 2012 Quiz 2</p><p>Name:</p><p>1. Write a loop in VB to print the numbers 1 through 50.</p><p>2. Write a For loop in VB to print the numbers 10 through 0.</p><p>3. Write the necessary VB code to display a message in the Label lblMessage, “You worked overtime!” when the value of TextBox txtHoursWorked is more than 40 hours. Otherwise, display the message, “Work more!”</p><p>4. Evaluate the following conditions and write True or False to indicate what the result of the evaluation will be. Use the values x = 10, y = 15, and z = False to evaluate the conditions. a. (x + y) > ( x + x) ______b. (x > y) Or ((y – x) < x) ______c. (x + y) > (x + x) And Not(z) ______d. Not (y > x And z = False) ______5. Use the following code and write what will be displayed on the screen after all the code executes. Dim str As String = “Hello” Dim i As Integer = str.length - 1 Do While (i > 0) Dim ch As Char = str.Chars(i) i = i - 1 Debug.WriteLine(ch) Loop</p><p>Use the following code to answer questions 6 – 7. Dim count As Integer = 0 Do While (count < 30) If count = 10 Then Exit Do End If</p><p> count = count + 1 Loop</p><p>6. How many times will the following loop execute?</p><p>7. What is the value of the variable count after the loop executes?</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us