Chapter 05 - Chapter 5_d 1 Which of the following controls...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 5 __d__ 1. Which of the following controls and methods provides a simple way to gather input from the user at runtime without placing a text box on a form? a. ListBox b. MessageBox c. ComboBox d. InputBox __b__ 2. The data in a ListBox is stored in the property. a. Items.Count b. Items c. Add d. Insert __c__ 3. To get the number of items stored in a ListBox, you use the property. a. Count b. Items c. Items.Count d. Number __b__ 4. The first item in a ListBox has an index of . a. - 1 b. 0 c. 1 d. 2 _a___ 5. Setting this property to True will put the items in a ListBox into alphabetical order. a. Sorted b. Organized c. Selection d. Alphabetic c____ 6. This method will erase all the items in a ListBox. a. Items.Delete b. Items.Erase c. Items.Clear d. Items.Remove _c___ 7. If a For Next loop begins with the following statement, what is the purpose of the Step clause? For intX = 1 to 100 Step 5 a. To initialize the loop control variable to 5. b. To indicate the test condition for ending the loop. c. To increment the loop control variable intX by 5 each time the loop repeatss. d. To specify the decrement value for the loop control variable intX. Chapter 5 29
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
_a___ 8. What is the difference in the execution of the Do Until Loop (first example) and the Do Loop Until (second example)? ' First Example sngPayAmount = 400 Do Until sngPayAmount > 150 ' Processing Steps sngPayAmount = sngPayAmount – 50 Loop 'Second Example sngPayAmount = 400 Do ' Processing Steps sngPayAmount = sngPayAmount – 50 Loop Until sngPayAmount > 150 a. The first loop will not execute. b. The first loop will execute one more time than the second loop. c. There is no difference between the two loops. d. If the test condition in the second loop is changed to sngPayAmount >= 150 , the loop will execute. _d___ 9. What is wrong with the following code? Dim intIndex As Integer For intIndex = 5 To 1 ListBox.Items.Add(intIndex ) Next a. In Visual Basic you must specify Next intIndex. b. You cannot add a number to a ListBox. c. intIndex is not a proper Loop control variable. d. You need to specify a negative step value in order to execute the loop. _c___ 10. What value is assigned to lblSum.Text by the following code ? Dim intTotal As Integer = 0 For intOuter = 1 To 3 For intInner = intOuter To 3 intTotal += intOuter * intInner Next Next lblSum.Text = intTotal.ToString() a. 9 b. 16 c. 25 d. 36
Background image of page 2
_b___ 11. Which code example will calculate the number of checked items in a CheckedListBox named clbMovie- Names,and store the number in intCheckedMovies? a.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/01/2011 for the course ITSE 1431 taught by Professor Gibson during the Spring '10 term at Central Texas College.

Page1 / 9

Chapter 05 - Chapter 5_d 1 Which of the following controls...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online