Name___________________________________
MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.
1) Which of the following adheres to the naming conventions for a text box control? 1) _______
A) LBLhoursworked B) txtHoursWorked
C) txthoursworked D) lblHoursWorked
2) Flowcharts are used to ________. 2) _______
A) describe the programs input and output
B) determine the controls required for a program
C) graphically depict the flow of a method
D) check for syntax errors
3) How would you display the Designer window if it is not visible in your project? 3) _______
A) Click View Designer on the Edit menu
B) Click the Designer option on the View menu
C) Press …show more content…
Ctrl+Alt+D on the keyboard
D) Press Shift+F9 on the keyboard
4) How do you display a tooltip? 4) _______
A) double click a button on the toolbar
B) hold the mouse pointer over a toolbar button for a few seconds
C) tab to the button on the toolbar so that it has the focus
D) single click a button on the toolbar
5) The purpose of a compiler is to ________. 5) _______
A) aid the programmer in commenting he/her code
B) convert a program from a programming language to machine code
C) aid the programmer in developing GUIs.
D) assemble and package the documentation for an application
6) A word that has a specific meaning in a programming language is called ________. 6) _______
A) a keyword B) a comment C) a variable D) an operator
7) The most common form of secondary storage is ________. 7) _______
A) RAM B) a disk drive C) the CPU D) all of the above
8) The purpose of an algorithm is to ________. 8) _______
A) list a set of steps to solve a problem
B) list the elements needed for the user interface
C) understand what a programming language does
D) analyze the nature of a problem
9) The auto hide feature ________. 9) _______
A) hides the controls on a form until the programmer changes the status
B) enables the programmer to hide a control on a form
C) causes a window to display as a tab along the edge of Visual Studio
D) permanently removes the toolbox from the Visual Basic environment
10) What is the purpose of the Toolbox? 10) ______
A) To select methods to be placed on the form.
B) To select controls and place on an application’s form.
C) To select event procedures associated with a control.
D) To design user defined methods.
11) Programs should use comments (remarks) to ________. 11) ______
A) help the human reader of the program B) make the code run faster
C) make a program run more efficiently D) make the program smaller in size
12) Which of the following is NOT an example of an event in Visual Basic? 12) ______
A) clicking a control
B) changing contents of a textbox
C) clicking a button
D) dragging a control to a form from the tool box
13) Application software refers to programs that ________. 13) ______
A) performs diagnostic tests on secondary storage
B) manage the computer’s hardware devices
C) controls the computers input/output
D) satisfy the needs of a user
14) Any control ________ should have a descriptive, programmer-defined name. 14) ______
A) whose name appears in a programming statement
B) used in a form
C) that is a label
D) with a text property
15) An object in Visual Basic ________. 15) ______
A) is an action performed by a method B) contains data called properties
C) is also referred to as an event handler D) is an attribute of a control
16) The part of a program that users see and work with is known as the ________. 16) ______
A) user interface B) algorithm C) methods D) properties
17) Why is it necessary to run a program using test data for input? 17) ______
A) To be sure that there are no syntax errors in the program.
B) To see if the flowchart is correct.
C) To verify the application produces correct results.
D) To verify that programming language elements are used correctly.
18) The Standard ToolBar ________. 18) ______
A) gives you quicker access to frequently used commands
B) is difficult to use, since you must remember the commands
C) allows the programmer to create user defined controls
D) allows the programmer to place controls on the form
19) A TextBox control ________. 19) ______
A) can be used to display graphical images
B) is used to describe other controls on the form
C) has the same function as a label control
D) accepts text entered by the user
20) When creating a Visual Basic desktop application, the last thing you will do is ________. 20) ______
A) correct syntax errors B) create the forms
C) correct runtime errors D) write code for even procedures
21) Which of the following is NOT a Visual Basic control? 21) ______
A) TextBox B) Label C) Form D) Algorithm
22) The CPU processes instructions are written only in this language. 22) ______
A) pseudo code B) Java
C) Visual Basic D) machine language
23) Which is considered a valid step for developing a Visual Basic application? 23) ______
A) Create a flowchart of the code.
B) Determine the controls needed.
C) Determine event handlers needed for each control.
D) all of the above
24) A form is a ________. 24) ______
A) box that displays text that cannot be changed by the user
B) control that displays a graphic image
C) window in which other controls may be placed
D) piece of data that determines a characteristic of a control
25) Which of the following is an example of a binary number? 25) ______
A) 123 B) 324 C) 101 D) 202
26) If you wish to display text which cannot be modified by the user, use the ________. 26) ______
A) Label control B) Caption control
C) Name control D) TextBox control
27) All of the following are major hardware components of a typical computer system except ________. 27) ______
A) Main Memory B) Operating System
C) CPU D) secondary storage
28) In Visual Basic we work with objects, which have ________. 28) ______
A) projects and solutions B) classes and actions
C) programmer preference D) properties and methods
29) A variable ________. 29) ______
A) is a storage location in memory represented by a name
B) is a key element of the graphical user interface
C) is a set of programming statements to perform a specific task
D) performs various operations on data
30) A programming statement must refer to a control by its ________ property. 30) ______
A) Identifier B) Name C) Text D) Form
31) Choose the correct assignment statement for a Label control named lblTitle that would align the control’s text with the middle and center of the control’s bounding box? 31) ______
A) lblTitle.TextAlign = ContentAlignment.Center
B) lblTitle.TextAlign = ContentAlignment.MiddleCenter
C) lblTitle.TextAlign = MiddleCenter
D) lblTitle.TextAlign = Middle
32) The ________ property of a label determines if the label can be seen by the user at runtime. 32) ______
A) Visible B) Enabled C) Invisible D) Active
33) A Visual Studio project may be saved in all of the following ways except ________. 33) ______
A) Click the Save All button on the standard toolbar
B) Click File on the menu bar, and then click Save All
C) Press Ctrl+Shift+S on the keyboard
D) Click the Save Project button on the standard toolbar
34) Programs should use comments (remarks) to ________. 34) ______
A) save time when you have to debug the program
B) save time when the program must be modified
C) explain what the code does
D) all of the above
35) You can display the Code window in all of the following ways except ________. 35) ______
A) Click the View Code button in the Solution Explorer window
B) Click View on the menu bar, then select Code
C) Press the F7 key
D) Click Project on the menu bar, and then click Show all files
36) The properties of a control are listed in the ________ window. 36) ______
A) Properties B) Project
C) Options D) Solution Explorer
37) The code template for an event handler identifies it as a type of ________ procedure. 37) ______
A) Method B) Module C) Sub D) Function
38) The value of a control’s property may be changed while the application is running by ________. 38) ______
A) using the Toolbox window B) using an assignment statement
C) using the Properties window D) all of the above
39) The ________ property can prevent the user from resizing, minimizing, or maximizing a window. 39) ______
A) ShowInTaskBar B) WindowState
C) MinMaxSize D) FormBorderStyle
40) In the statement Me.Close(), the keyword Me refers to ________. 40) ______
A) the current form B) the Close method
C) the programmer D) the Close button
41) A label control may be added to a form by a double-click on the Label control icon in the ________ window. 41) ______
A) Designer B) Project C) ToolBox D) Properties
42) You can run an application in all of the following ways except ________. 42) ______
A) Press the Ctrl-F4 keys
B) Press the F5 key
C) Click Debug on the menu bar, and then click Start Debugging
D) Click the Start Debugging button on the toolbar
43) Which of the following is not a valid value for the FormBorderStyle property? 43) ______
A) FixedDouble B) Fixed3D C) FixedSingle D) Sizable
44) What will the following section of code do?
Private Sub btnExit_Click(ByVal sender As System.Object, _ ByVal e as System.EventArgs) Handles btnExit.Click
Me.Close() End Sub 44) ______
A) Log off the current user B) Close the current form
C) Shut down the computer D) all of the above
45) A Visual Basic project file is saved with this file extension. 45) ______
A) .vbproj B) .sln C) .proj D) .vb
46) Which of the following statements are correct? 46) ______
A) A Visual Basic project may have multiple solutions.
B) A Visual Basic project is a container that holds a solution.
C) A Visual Basic project must belong to a solution.
D) Both A and B are correct.
47) In order to delete a control from a form, you should select the control and then ________. 47) ______
A) hit the Delete key on the keyboard
B) click Delete from the View menu
C) click the Cut icon in the Properties window
D) click the Remove Item icon on the menu bar
48) A Label control’s ________ property allows a label to change size to fit the text in its text property. 48) ______
A) Size B) TextAlign C) Grow D) Autosize
49) Which property is used to automatically adjust an image to fit the size of a PictureBox control? 49) ______
A) SizeAdjust B) AutoFit C) SizeMode D) AutoAdjust
50) If a Label control's AutoSize property equals False and the label is not wide enough for the text assigned to the control, ________. 50) ______
A) none of the text will be displayed
B) the label will expand to fit the text
C) the extra text is wrapped onto the next line or lines
D) the text will be only partially displayed
51) Which of the following declares a variable that can store the first name of a student? 51) ______
A) Dim strFirstName as Short B) Dim strFirstName as String
C) Dim strFirstName as Char D) Dim strFirstName as Long
52) The value returned by passing #12/31/10# to the CSng function is ________. 52) ______
A) 0
B) 123,110
C) 12/31/2010
D) No value is returned. A runtime error is generated.
53) What is the value of dblOutcome after the following section of code executes?
`Dim dblA as Double Dim dblB as Double Dim dblC as Double Dim dblOutcome as Double dblA = 45 dblB = 30 dblC = 3 * dblA / dblB dblOutcome = 2 * (dblC + 15) 53) ______
A) 80 B) 24 C) 39 D) 0
54) What is the purpose of using the following type of structure?
Try Some statements Catch Other Statements End Try 54) ______
A) To use for temporary debugging and remove later when the program functions properly.
B) In order to catch run-time errors such as divide-by-zero and not have the program shut down.
C) This is not a valid structure.
D) To try different types of commands to see which will give you the correct answer.
55) Which of the following has the highest order of precedence in arithmetic expressions? 55) ______
A) Exponentiation
B) Multiplication and division
C) Addition and subtraction
D) None of the above; calculations are always evaluated from left to right.
56) It's possible to view the order in which all controls on a form will receive the focus by ________. 56) ______
A) clicking View on the menu bar and then Tab Order
B) clicking TabOrder in the Properties window
C) pressing the Esc key
D) all of the above
57) Identify the error in the following code:
Private Sub btnCalculate_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnCalculate.Click ' Declare some variables Dim sngNumber1 As Single Dim sngNumber2 As Single Dim sngSum As Single
' Get the two numbers sngNumber1 = txtNumber1.Text sngNumber2 = txtNumber2.Text ' Calculate their sngSum... is the next line working? sngSum = sngNumber1 + sngNumber2 ' Display the result lblSum.Text = sngSum.ToString End Sub 57) ______
A) The variable sngSum was declared as the wrong data type.
B) The variable name sngNumberl was misspelled.
C) A local variable is misplaced.
D) A conversion function such as CSng was not used.
58) In order to execute code before a form is displayed, place the code in the form's ________ event handler. 58) ______
A) SetUp B) Focus C) Initialize D) Load
59) You can break up a long statement into multiple lines as long as you don't break up a ________. 59) ______
A) keyword B) variable name C) quoted string D) all of the above
60) The order in which controls receive the focus is called the ________. 60) ______
A) control order B) sequence order C) tab order D) focus order
61) What default value is assigned to a Boolean variable? 61) ______
A) True B) 0 C) False D) 1
62) The ________ operator performs string concatenation. 62) ______
A) pound symbol (#) B) dollar sign ($)
C) ampersand (&) D) percent symbol (%)
63) What will be the value of intAnswer after execution of these statements?
Const intNumA As Integer = 6
Const intNumB As Integer = 2 intAnswer = intNumA / intNumB + intNumA * intNumB 63) ______
A) 15 B) 18 C) 16 D) 12
64) Which of the following is an example of a control?
64) ______
A) Button B) Form C) TextBox D) all of the above
65) When you select a form control in design mode, ________. 65) ______
A) the project will automatically be saved B) its color changes to dark blue
C) the tool box will be visible D) its sizing handles appear
66) When Visual Studio displays a new project, a blank form is shown in the ________ window. 66) ______
A) ToolBox B) Designer C) Properties D) Project
67) When you have an item selected and press the F1 key, you get ________. 67) ______
A) tool-tip for the item B) properties window
C) context-sensitive help D) the solution explorer window
68) Which of the following is NOT the way to end a Visual Basic application? 68) ______
A) Click Debug on the menu bar, and then click Stop Debugging.
B) Press Ctrl+Alt+Break on the keyboard.
C) Click the down arrow on the Debug list box, and then click on Release.
D) Click the Close button on the applications window.
69) If the Visible property of a control is set to false, it ________ in the Designer window. 69) …show more content…
______
A) becomes inactive B) is grayed out
C) continues to be shown D) is no longer displayed
70) Assume you have a Button control named btnDisplayList. Which is the default name for an event procedure that will be executed when the user clicks on the control? 70) ______
A) Click_btnDisplayList B) btnDisplayList_ClickEvent
C) btnDisplayList_Click D) btnDisplayList_ClickButton
71) The code that is executed when the user clicks a button is known as ________. 71) ______
A) a keyword B) a property
C) an event handler D) a control
72) Compile errors ________. 72) ______
A) are errors such as misspelled key words or incorrect use of operators
B) are errors found while an application is running
C) result from an attempt to perform an operation that cannot execute
D) are not syntax errors
73) Which of the following statements will copy the contents of a TextBox named txtInput into a Label named lblDisplay?
73) ______
A) txtInput = lblDisplay B) lblDisplay.Text = txtInput.Text
C) txtInput.Text = lblDisplay.Text D) lblDisplay = txtInput
74) What is the result after evaluating the following expression: 24 Mod 9? 74) ______
A) 2 B) 3 C) 6 D) 5
75) What will be assigned to the label when the following statements execute?
Dim dblVal As Double = 11.75 lblResult.Text = dblVal.ToString("n3") 75) ______
A) 11.75 B) 12 C) 11.750 D) $11.75
76) All numeric and date data types have a ________ method that returns a string representation of the contents of the variable. 76) ______
A) String B) ToText C) Convert D) ToString
77) The ________ control(s) can have the focus. 77) ______
A) Label B) TextBox and Button
C) TextBox D) Button
78) The contents of a text box may be cleared in Visual Basic code by ________. 78) ______
A) clicking the clear button
B) setting the focus on the control and using the back space key
C) assigning the predefined constant String.Empty to the text property
D) setting the focus on the control and using the delete key
79) The ________ property appears in parentheses so it will appear at the top of the alphabetical Property list. 79)
______
A) Visible B) Text C) Name D) all of the above
80) The color of the text in a Label control is determined by the ________ property. 80) ______
A) Font B) TextColor C) ForeColor D) Color
81) Which of the following displays a message box with the text "Hello World"? 81) ______
A) MessageBox.Text("Hello World") B) MessageBox.Send("Hello World")
C) MessageBox.Display("Hello World") D) MessageBox.Show("Hello World")
82) Intellisense ________. 82) ______
A) provides automatic code as you write programming statements
B) provides hints about the input data requested from the user
C) allows the user to easily modify properties for a control in design mode
D) is a feature that will help the programmer use proper naming conventions
83) The ________ control is used to gather input the user has typed at the keyboard. 83) ______
A) TextBox B) ListBox C) Label D) Button
84) A class-level variable ________. 84) ______
A) is visible to all statements inside the class
B) is declared inside a class but outside any procedure
C) is accessible to all procedures in a class
D) all of the above
85) To lock all of the controls on a form during design time ________. 85) ______
A) right-click an empty spot on the form, then select the Lock Controls option from the pop-up menu
B) left-click an empty spot on the form, then click Locked in the properties window
C) click Window on the Menu Bar, then click Lock Controls
D) right-click the form, then click the lock controls icon on the toolbar
86) Which property determines the characters that appear in the title bar of Form1? 86) ______
A) Form1.Text B) Form1.Name C) Form1.Caption D) Form1.Title
87) All of the following are advantages of using named constants except ________. 87) ______
A) it is easier to make a consistent change throughout a program
B) they can be used in the place of keywords
C) they help make the program more self documenting
D) they're useful for common values such as pi
88) Which of the following is False in regard to naming variables? 88) ______
A) Names may contain spaces. B) Names may contain underscores.
C) Names may contain letters. D) Names may contain digits.
89) When you assign a value of one data type to a variable of another data type, Visual Basic attempts to perform ________ type conversion. 89) ______
A) explicit B) implicit C) numeric D) string
90) Declaration statements ________. 90) ______
A) are only used for variables and are not needed for constants
B) give a name to variables or constants and specifies the type of data they will hold
C) are only allowed in the Declarations section of a form
D) both answers B and C are correct
TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false.
91) Control names may begin with a letter or a number. 91) ____F__
92) Microsoft Visual Basic is an object-oriented programming language. 92) ___T___
93) Properties determine the visual appearance of a control. 93) _T_____
94) A variable is a storage location on a computer's hard drive that holds information while the computer is off. 94) ____F__
95) A form Load event takes place when the user first clicks on the form at run time. 95) ____F__
96) Pseudocode is a combination of programming language and machine code. 96) ___F___
97) When you declare a constant, you must assign it an initial value. 97) ____T__
98) A control is an object that usually appears in a program’s graphical user interface. 98) ___F___
99) When included in the Text property of a button, the && symbols placed side by side will display as a single & character. 99) ___T___
100) Control names may not contain spaces. 100) __T___