Intro to Coding Test Two

Ace your homework & exams now with Quizwiz!

he loop controlled by the correct For clause from Review Question 9 will end when the intX variable contains the number

100

The computer will stop processing the loop in Review Question 6 when the intCount variable contains the number

14

Which of the following methods is used to add items to a list box?

Add

Which of the following For clauses indicates that the loop instructions should be processed as long as the intX variable's value is less than 100?

For intX As Integer = 10 To 99

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

Four

The items in a list box belong to which collection?

Items

How many times will the string literal "Hi" appear in the lblMsg control? Dim intCount As Integer Do lblMsg.Text = lblMsg.Text & "Hi" & ControlChars.NewLine intCount += 1 Loop While intCount > 4

One

Which of the following properties stores the index of the item selected in a list box?

SelectedIndex

Which event occurs when the user selects a different item in a list box?

SelectedValueChanged

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

Zero

If a list box's Sorted property is set to False, how will the numbers 4, 35, 3, 1, and 12 be displayed in the list box? a. 4, 35, 3, 1, 12 b. 1, 3, 4, 12, 35 c. 1, 12, 3, 35, 4 d. 35, 12, 4, 3, 1

a. 4, 35, 3, 1, 12

Which of the following clauses will stop the loop when the value in the intPopulation variable is less than the number 5000?

a. Do While intPopulation >= 5000 b. Do Until intPopulation < 5000 c. Loop While intPopulation >= 5000 d. All of the above

Which of the following statements can be used to code a loop whose instructions you want processed 10 times?

a. Do...Loop b. For...Next c. All of the above.

Which of the following calculates the monthly payment (expressed as a positive number) for a loan of $10,000 for 2 years with a 3.5% annual interest rate? a. -Financial.Pmt(0.035, 2, 10000) b. -Financial.Pmt(0.035 / 12, 2 * 12, 10000) c. -Financial.Pmt(2 * 12, 0.035 / 12, 10000) d. -Financial.Pmt(10000, 0.035 / 12, 2 * 12)

b. -Financial.Pmt(0.035 / 12, 2 * 12, 10000)

If a list box's Sorted property is set to True, how will the numbers 4, 35, 3, 1, and 12 be displayed in the list box? a. 4, 35, 3, 1, 12 b. 1, 3, 4, 12, 35 c. 1, 12, 3, 35, 4 d. 35, 12, 4, 3, 1

c. 1, 12, 3, 35, 4

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

d. 30

Which of the following statements is equivalent to the statement dblTotal = dblTotal + dblSales?

dblTotal += dblSales

To make the btnCalc control the default button, you need to set the ___ property.

form's AcceptButton

Which of the following statements selects the fourth item in the lstNames control?

lstNames.SelectedIndex = 3

The instructions in a ___ loop might not be processed at all, whereas the instructions in a ___ loop are always processed at least once.

prestest; posttest


Related study sets

Chapter 18: Society and Politics in the Gilded Age, 1865-1900

View Set

Personal Financial Literacy - Chapter 12

View Set

Contraindication for Postural Drainage

View Set

Inflammatory bowel disease- Pearson

View Set

C763 HEALTH INFORMATION SYSTEMS MANAGEMENT

View Set