Program4windows chap 5

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

3. T F: The Items.RemoveAt method always removes the last item in a list box the item with the highest index value).

(False)

Which loop should you use in situations where you wish the loop to repeat as long as the test expression is true?

-Do While Loop

Which type of loop should you use in situations where you wish the loop to repeat until the test expression is true?

-Do until Loop

1. What buttons automatically appear on an input box?

-The buttons that automatically appear on an input box is "OK" and "Cancel".

Write a statement that removes the item at index 12 of the combo box named cboCourses.

-cboCourses.Items.RemoveAt(12)

Write a statement that adds Spinach to the list box lstVeggies at index 2.

-lstVeggies.Items.Insert(2, "Spinach")

4. A list box or combo box's index numbering starts at this value.

0

What feature do combo boxes have that list boxes do not have?

A combo box performs many of the same functions as a list box, and it can also let the user enter text.

Why are the statements in the body of a loop called conditionally executed statements?

Because the statements in the body of the loop are executed only under the condition that the Boolean expression is true.

7. The Do While statement marks the beginning of a Do While loop, and the Loop statement marks the end. The statements between these are known as one of the following.

Body of the loop

13. This control has a rectangular area that functions like a text box.

Combo box

17. Which of the following statements creates a Random object and initializes the sequence of random numbers with the seed value 25?

Dim rand As New Random(25)

With one style of combo box the Text property is read-only. Which style?

Drop-Down List Combo Box

With one style of combo box the user may not type text directly into the combo box, but must select an item from the list. Which style is it?

Drop-Down List Combo Box

What value is returned by the InputBox function if the user clicks the Cancel button?

Empty String.

8. The _______ statement, when placed inside the body of a Do While loop, stops the execution of the loop and causes the program to jump to the statement immediately following the loop.

Exit-Do

1. T F: If you do not provide a value for an input box's title, an error will occur.

False)

10. T F: The For...Next loop is a posttest loop.

False)

13. T F: A drop-down list combo box allows the user to either select an item from a list or type text into a text input area.

False)

2. T F: If the user clicks an input box's Cancel button, the function returns the number −1.

False)

6. T F: A pretest loop always performs at least one iteration, even if the test expression is false from the start.

False)

10. This type of loop is ideal for situations that require a counter because it is specifically designed to initialize, test, and increment a counter variable.

For...Next

Which type of loop should you use when you know the number of required iterations?

For...Next loop

15. The ______ function returns the required interest payment for a specific period on a loan.

IPmt

Describe the difference between pretest loops and posttest loops.

In a pretest loop, the Boolean expression is tested first. If the expression is true, the loop then executes the statements in the body of the loop. This process repeats until the Boolean expression is false. In a posttest loop, the statements in the body of the loop are executed first, and then the Boolean expression is tested. If the Boolean expression is true, the loop repeats. If the Boolean expression is false, the loop stops.

1. You display input boxes with this function.

InputBox

6. This method erases one item from a list box.

Items.Remove

7. Each repetition of the loop is called a(n)_______

Iteration.

2. A(n)____ control displays a list of items and allows the user to select an item from the list.

ListBox

12. When this ListBox control's property is set to True, it causes the ListBox control to display its list in multiple columns.

Multicolumn

11. You do this to get the total number of iterations of a nested loop.

Multiply the number of iterations of all the loops

11. The _________ method generates a random integer.

Next

12. The method generates a random floating-point value.

NextDouble

Describe the two important parts of a Do While loop.

One: a Boolean expression that is tested for a True or False value Two: a statement or group of statements that is repeated as long as the Boolean expression is true

14. The ______ function returns the principal payment for a specific period on a loan.

PPmt

13. The ______ function returns the periodic payment amount for a loan.

Pmt

6. A(n) _______ evaluates its test expression after each iteration.

Posttest loop

8. This type of loop evaluates its test expression before each iteration.

Pretest

10. A(n)______ has methods that can generate a sequence of random numbers.

Random object

9. One of the following is a sum of numbers that accumulates with each iteration of a loop.

Running total

3. Visual Basic automatically adds this to a list box when it contains more items than can be displayed.

Scroll bar

5. This property holds the index of the selected item in a list box.

SelectedIndex

15. With this style of combo box, the list of items does not drop down, but is always displayed.

Simple combo box

2. An input box returns the value entered by the user as this.

String

16. This combo box property will contain the user's text input or the item selected from the list.

Text

What is the difference between the Do While loop and the Do Until loop?

The Do While loop iterates until its test expression is false. The Do Until loop iterates until its test expression is true.

What value does a Random object use as its seed if you do not specify a seed value?

The system time from the computer's internal clock.

11. T F: In a nested loop, the inner loop goes through all of its iterations for each iteration of an outer loop.

True)

12. T F: To create a checked list box, you draw a regular list box and set its Checked property to True.

True)

14. T F: If a Random object is initialized with the same seed value each time it is created, it will produce the same series of random numbers each time.

True)

4. T F: Infinite loops keep repeating until the program is interrupted.

True)

5. T F: A loop's conditionally executed statements should be indented.

True)

7. T F: The Do While loop may be written as either a pretest or posttest loop.

True)

8. T F: In a For...Next loop, the CounterVariable must be numeric.

True)

9. T F: The Step Increment part of the For...Next statement is optional.

True)

In general terms, describe how a Do While loop works.

When the loop runs, the BooleanExpression is tested. If it is true, then the statements in the body of the loop are executed. Then the loop starts over and the BooleanExpression is tested again. If it is still true, the statements in the body of the loop are executed. This cycle repeats until the BooleanExpression is false.

Why should you indent the statements in the body of a loop?

You can quickly see which statements are repeated by the loop because they are indented.

14. This is the prefix that we use for combo box names.

cbo

5. A(n) _______ is a variable that is regularly incremented or decremented each time a loop iterates.

counter

4. If a loop does not have a way of stopping, it is called a(n)_____

infinite loop.

1. A(n)___provides a simple way to gather input without placing a text box on a form.

input box

9. A loop that is inside another loop is called a(n)__________.

nested loop.

3. A(n) _____, or loop, causes one or more statements to repeat.

repetition structure


संबंधित स्टडी सेट्स

Ch. 17 Staffing Needs and Scheduling Policies

View Set

Chapter 51: Assessment and Management of Patients with Diabetes Prep-U

View Set

ATI Learning System RN 3.0 Fundamentals 1 Quiz

View Set

Auditing II: Final Exam Homework Review

View Set