Professional Documents
Culture Documents
MULTIPLE RESPONSE
1. ____ is a fundamental process that repeats instructions until a condition is true or while a condition is
true.
a. Iteration c. Looping
b. Concatenation d. Documenting
ANS: A, C PTS: 1 REF: 378
2. Instead of typing the menu name on a MenuStrip object, you can add a ____ by clicking the Type Here
box’s list arrow and selecting the appropriate choice
a. radio button c. menu item
b. combo box d. text box
ANS: B, C, D PTS: 1 REF: 383
3. A compound operator allows you to ____ values, storing the result in the same variable.
a. add c. compare
b. multiply d. divide
ANS: A, C, D PTS: 1 REF: 396
4. The ____ values used in a For...Next loop can vary based on input from a user.
a. beginning c. ending
b. step d. range
ANS: A, B, C PTS: 1 REF: 404
5. The Publish Wizard allows you to create an install file to be placed on a ____.
a. floppy disk c. Web server
b. network drive d. hard drive
ANS: B, C, D PTS: 1 REF: 426
MODIFIED TRUE/FALSE
1. When used in a menu name, the asterisk character is used to indicate that a character is a hot key.
_________________________
ANS: F, ampersand
4. Smart actions can be specified for a menu by using Action Tags. _________________________
5. The Checked property of a ListBox object identifies which item in the ListBox has been selected.
_________________________
ANS: F, SelectedItem
MULTIPLE CHOICE
3. The ____ character is used to indicate that a letter is a hot key on a menu item.
a. ampersand (&) c. back slash (\)
b. forward slash (/) d. underscore (_)
ANS: A PTS: 1 REF: 383
4. The hot key for a menu item can be activated with the keyboard by pressing the ____ key and the hot
key at the same time.
a. ALT c. CTRL
b. SHIFT d. TAB
ANS: A PTS: 1 REF: 383
7. The feature shown in the accompanying figure provides an easy way for you to specify ____ actions
for an object as you design a form.
a. baseline c. indexed
b. smart d. object-oriented
ANS: B PTS: 1 REF: 386
8. The ____ function provides a dialog box that asks the user for input and provides an input area.
a. InputArea c. MessageBox
b. InputBox d. UserEntry
ANS: B PTS: 1 REF: 387
9. A ____ object displays a collection of items, or values, with one item per line.
a. TextBox c. ListBox
b. RadioButton d. CheckBox
ANS: C PTS: 1 REF: 390
10. Which line of code will add the value “East” to a ListBox object named lstDirections?
a. lstDirections.Add(“East”) c. lstDirections.AddValue(“East”)
b. lstDirections.Items.Add(“East”) d. lstDirections.Items.AddValue(“East”)
ANS: B PTS: 1 REF: 391
11. To remove all objects from a ListBox object, the ____ method is used.
a. Clear c. Empty
b. Items.Clear d. Items.Empty
ANS: A PTS: 1 REF: 392
12. The ____ property of a ListBox object identifies which item in the ListBox was selected.
a. Item c. Selected
b. ItemSelected d. SelectedItem
ANS: D PTS: 1 REF: 395
13. A(n) ____ variable collects a total value over a period of time.
a. catalog c. register
b. glossary d. accumulator
ANS: D PTS: 1 REF: 396
14. A(n) ____ variable keeps track of how many times a loop has executed.
a. counter c. glossary
b. accumulator d. register
ANS: A PTS: 1 REF: 396
15. A ____ operator allows you to perform arithmetic operations with a variable and store the results back
to that variable.
a. logical c. compressed
b. rational d. compound
ANS: D PTS: 1 REF: 396
16. The compound operator ____ adds the value of the right operand to the value of the left operand and
stores the result in the left operand’s variable.
a. ++ c. =+
b. += d. ==
ANS: B PTS: 1 REF: 397
17. The compound operator ____ is used to add a string to an existing string.
a. &= c. &&
b. =& d. ==
ANS: A PTS: 1 REF: 397
19. A ____ loop is best used when the specific number of iterations required is known.
a. Do…While c. For...Next
b. Do…Until d. For…Until
ANS: C PTS: 1 REF: 399
20. A loop’s ____ variable is a numeric variable that keeps track of the number of iterations the loop
completes.
a. compound c. matrix
b. accumulated d. control
ANS: D PTS: 1 REF: 399
22. A For...Next loop with a beginning value of 1, an ending value of 25, and a Step value of 3 will
execute ____ times.
a. 3 c. 9
b. 8 d. 25
ANS: C PTS: 1 REF: 400
25. If ____ appears as the first line of a loop, the loop is a top-controlled Do loop that will execute as long
as a condition remains true.
a. Loop While c. Loop Until
b. Do While d. Do Until
ANS: B PTS: 1 REF: 406
26. A ____-controlled loop tests the condition before the loop body is executed.
a. bottom c. top
b. key d. function
ANS: C PTS: 1 REF: 406
27. A ____-controlled loop tests the condition after the code in the loop body has been executed.
a. bottom c. top
b. function d. key
ANS: A PTS: 1 REF: 406
28. If ____ appears as the last line of a loop, the loop is a bottom-controlled Do loop that will execute as
long as a condition remains true.
a. Loop While c. Loop Until
b. Do While d. Do Until
ANS: A PTS: 1 REF: 409
29. If ____ appears as the first line of a loop, the loop is a top-controlled Do loop that will stop execution
when a condition becomes true.
a. Loop While c. Loop Until
b. Do While d. Do Until
ANS: D PTS: 1 REF: 410
30. If ____ appears as the last line of a loop, the loop is a bottom-controlled Do loop that will stop
execution when a condition becomes true.
a. Loop While c. Until
b. Do While d. Loop Until
ANS: D PTS: 1 REF: 412
31. As demonstrated in the accompanying figure, a loop that does not terminate is called a(n) ____ loop.
a. breakaway c. runaway
b. infinite d. unstoppable
ANS: B PTS: 1 REF: 412
32. Using a preset value for the variable tested in a loop condition is a process called ____ the loop.
a. iterating c. presetting
b. priming d. rebanding
ANS: B PTS: 1 REF: 413
33. The ____ function can be used to test if data entered by the user is numeric.
a. IsInteger c. IsNumeric
b. IsNumber d. IsNonAlpha
ANS: C PTS: 1 REF: 414
34. What will be the value of the variable intTotalCount when the following code is executed?
For intOuterCount = 1 to 5
For intInnerCount = 1 to 4
intTotalCount +=1
Next
Next
a. 4 c. 9
b. 5 d. 20
ANS: D PTS: 1 REF: 416
35. When in break mode, you can use ____ to examine the value of variables.
a. DataTags c. DebugTags
b. DataTips d. DebugTips
ANS: B PTS: 1 REF: 417
36. As shown in the accompanying figure, ____ are stop points placed in the code to tell Visual Studio
2010 debugger where and when to pause the execution of the program.
a. breakpoints c. halt points
b. debug points d. tracepoints
ANS: A PTS: 1 REF: 417
37. By default, when a program reaches the item shown in the accompanying figure and pauses execution,
the line of code that is about to be executed is highlighted in what color?
a. blue c. red
b. green d. yellow
ANS: D PTS: 1 REF: 421
38. You can create a deployed version of a program by using the ____ process.
a. ClickDeploy Installation c. ClickOnce Deployment
b. ClickInstall Deployment d. ClickPublish Deployment
ANS: C PTS: 1 REF: 425
40. In order to run a program deployed with ClickOnce Deployment, the computer needs ____ installed on
it.
a. Microsoft Word c. PowerBuilder
b. Visual Studio 2010 d. none of the above
ANS: D PTS: 1 REF: 425
TRUE/FALSE
1. MenuStrip objects can be placed along any edge of the form, depending on which side is closer to the
mouse pointer.
3. Writing an event handler for a menu item is the same as writing an event handler for a button click.
4. The InputBox function returns a null string (“”) when a user clicks the Cancel button.
5. The prompt message displayed in an InputBox object can be customized by the programmer.
6. If the user enters a numeric value in an InputBox object, the InputBox function will return a numeric
data type.
7. All data collected by an InputBox object is automatically converted to the best data type for the data.
8. An InputBox object allows user input without the need for a TextBox object on the Windows Form
object.
9. When the user clicks the Cancel button in an input box and the InputBox function returns a null
character, the program can test for the null character to determine further processing.
10. You must include a Step value in a For...Next loop, even if the Step value is 1.
11. The beginning and ending values for a For...Next loop must be predefined and cannot contain an
expression.
12. The Step value for a For...Next loop must be a positive whole integer value.
14. It is best to indent the body of the loop, to identify clearly the code that is being repeated.
15. The beginning, ending, and step values used in a For...Next loop can vary based on input from a user.
16. In a Do While loop, the body of the loop is executed until the condition becomes true.
18. Starting a loop with a preset value for the variable tested in the condition is called priming the loop.
19. When expecting a number from an input box, the IsNumeric function should be used to ensure that the
input data can be converted to a numeric variable.
21. When nesting loops, the inner loop must be completely contained in the outer loop and must use a
different control variable.
23. Breakpoints are stop points placed in the code where execution will be paused during the execution of
the program, and enter debug mode.
25. The installation files created by the ClickOnce Publishing Wizard can be used for a software release.
COMPLETION
1. A(n) ____________________ is a strip across the top of a window that contains one or more menu
names.
ANS: menu
3. In Visual Studio 2010, a(n) ____________________ object is used to place menus at the top of a
Windows Application form.
ANS: MenuStrip
5. The ____________________ procedure of the Windows Form object closes the form and causes the
program to exit.
ANS: Close
6. A(n) ____________________ object is a dialog box that prompts the user to enter a value.
ANS: InputBox
ANS: items
ANS: SelectedItem
ANS: Next
10. A(n) ____________________ value is the value in a For...Next loop that is added to, or subtracted
from, the beginning value on each iteration of the loop.
ANS:
Step
step
11. A(n) ____________________ loop should be used when the iterations should continue while or until a
condition is true or false.
ANS: Do
ANS: Do While
13. A(n) ____________________ loop should be used when the iterations should continue until a
condition becomes true.
ANS: Do Until
14. A(n) ____________________ loop is a loop placed completely inside another loop.
ANS: nested
15. The process of ____________________ involves resolving defects in the program code.
ANS: debugging
16. A(n) ____________________ is used to pause the execution of code while debugging.
ANS: breakpoint
17. While in break mode, you can examine the values in all variables that are within the scope of
execution through the use of ____________________.
ANS: DataTips
18. After an application is completely debugged and working properly, you can ____________________
it.
ANS: deploy
19. In Visual Basic 2010, a deployed program can be created easily by using ____________________
Deployment.
ANS: ClickOnce
20. The ____________________ Wizard is used to publish a program using ClickOnce Deployment.
ANS: Publish
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a. ListBox f. For...Next
b. wizard g. breakpoint
c. bottom-controlled h. looping
d. infinite i. InputBox
e. accumulator j. Do Until
1. The process of repeating a set of instructions while a condition is true or until a condition is true
2. Objects that can be assigned a default value representing the most likely user input
3. Used to publish a program using ClickOnce Deployment
4. Items added to this kind of object during design phase are available for selection by the user during
program execution
5. A variable that contains an accumulated value such as a running total
6. Loop that should be used when code is to be executed a known, exact number of times
7. Loop in which the body of the loop is executed until the condition becomes true
8. A loop that is always executed at least once
9. A loop that never ends
10. Identified in the code editor with a bullet to the left of the line number and highlighting of the code on
that line
ESSAY
ANS:
A compound operator allows you to add, subtract, multiple, divide, use modulus or exponents, or
concatenate strings, storing the result in the same variable. An assignment statement that includes a
compound operator begins with the variable that will contain the accumulated value, such as an
accumulator or a counter, followed by the compound operator. A compound operator consists of an
arithmetic operator and an equal sign. The last element in the assignment statement is the variable or
literal containing the value to be used in the calculation
ANS:
In a Do loop, the body of the loop is executed while or until a condition is true or false. The Do loop
uses a condition similar to an If…Then decision structure to determine whether it should continue
looping. In this way you can use a Do loop to execute a body of statements an indefinite number of
times.
Visual Basic 2010 provides two types of Do loops: the Do While loop and the Do Until loop. Both Do
loops execute statements repeatedly until a specified condition becomes true or false. Each loop
examines a condition to determine whether the condition is true. The Do While loop executes as long
as the condition is true.
Do loops are either top-controlled or bottom-controlled, depending on whether the condition is tested
before the loop begins or after the body of the loop has executed one time. A top-controlled loop is
tested before the loop is entered; the body of a top-controlled loop might not be executed at all because
the condition being tested might be true before any processing in the loop occurs.
Bottom-controlled loops test the condition at the bottom of the loop, so the body of a
bottom-controlled loop is executed at least once..
ANS:
A good way to collect information is to pause the execution of the code where a possible error could
occur. One way to pause execution is to use breakpoints. Breakpoints are stop points placed in the
code to tell the Visual Studio 2010 debugger where and when to pause the execution of the
application. During this pause, the program is in break mode. While in break mode, you can examine
the values in all variables that are within the scope of execution through the use of DataTips.
CASE
Chris is trying to decide which kind of loop is the best loop for him to use to solve a couple of
different programming challenges that he faces.
1. Chris knows the exact number of repetitions he needs the loop to execute. Which of the following is
the best choice for him?
a. top-controlled Do While c. bottom-controlled Do While
b. bottom-controlled Do Until d. For…Next
ANS:
D
Test Bank for Microsoft Visual Basic 2010 for Windows, Web, Office, and Database Application
2. Chris wants to guarantee that the instructions within the loop are executed one time regardless of the
status of a condition. Which of the following should he use?
ANS:
A
Robin thinks that she has a good handle on the use of compound operators but she wants to do a
couple of sample problems just to make certain. In both of the problems below, Robin assumes that
intResult = 24.
3. When Robin correctly calculates intResult -= 3, what value does she get?
a. 18 c. 72
b. 21 d. None of the above
ANS:
B
4. When Robin correctly calculates intResult ^= 2, what value does she get?
a. 22 c. 48
b. 24 d. 576
ANS:
D