You are on page 1of 111

1

CORRECT Microsoft Windows uses a GUI environment. GUI (pronounced "gooey") stands for
_______.

A)Geographical User Interchange

B)Graphical User Interface

C)Geometrical Upper Intelligence

D)Grammatical User Incorporation

2
CORRECT Visual Basic is a(n) _______.

A)Procedural programming language

B)Object-oriented programming language

C)Hyperlink programming language

D)Sequential programming language

3
CORRECT In Visual Basic, we work with objects that have _______.

A)Programmer preference

B)Projects, solutions, and procedures

C)Classes, actions, and disciplines

D)Properties, methods, and events


4
CORRECT When you plan a Visual Basic program, you follow a three-step process that should
end with _______.

A)Setting the properties

B)Writing the Basic code

C)Coding all of the remark statements

D)Defining the user interface

5
CORRECT After the steps for planning a Visual Basic project are competed, you can begin
actually constructing a program by _______.

A)Setting the properties

B)Creating the interface

C)Writing the code

D)Executing the next step based on the programmer's preference

6
CORRECT Which of the following shows the correct order for creating a Visual Basic program?

A)Set the properties, create the interface, write the code

B)Create the interface, set the properties, write the code

C)Create the interface, write the code, set the properties


D)Write the code, set the properties, create the interface

7
CORRECT The _______ holds information about the solution and the projects it contains. This
is the file that you open to work on or run your project

A)The project file

B)The resource file

C)The solution file

D)The .vb file

8
CORRECT Each Visual Basic project contains a text file that defines all resources used by the
form. This file has a _______ extension

A)Resx

B)Designer.vb

C)sln

D)vb

9
CORRECT The Visual Studio environment contains many different windows. Which window will
be the user interface when the project is running?

A)The Toolbox

B)The Solution window


C)The Properties window

D)The Form Designer window

10
CORRECT Which window do you open if you want to see all of the objects that you can add to
a form?

A)The Toolbox

B)The Solution window

C)The Properties window

D)The Form Designer

1
CORRECT Which of the following objects is a container?

A)MaskedTextBox

B)GroupBox

C)RadioButton

D)RichTextBox

2
CORRECT The property used to display information in a TextBox is _______.

A)Caption
B)Name

C)Text

D)Appearance

3
CORRECT In NameTextBox.Text, _______.

A)The property is NameTextBox

B)The property is Text

C)The object is Name

D)The object is Text

4
CORRECT If you want to display text that cannot be modified by the user, use the _______.

A)TextBox control

B)Label control

C)Caption control

D)MaskedTextBox control

5
CORRECT If you want to display text that can be modified by the user, use the _______.
A)TextBox control

B)Label control

C)Caption control

D)MaskedTextBox control

6
CORRECT Assume that you are designing a form and it will be necessary for the user to type
in his name. You should use a _____________ for inputting the user's name

A)Textbox

B)Label

C)Button

D)CheckBox

7
CORRECT You can modify the setting in the _______ property if you want to align the text in
a textbox to appear on the left side of the box

A)AlignLeft

B)Text

C)Left

D)TextAlign
8
CORRECT In code, you can make the text in a text box display left-aligned by using
________.

A)ObjectName.TextAlign = HorizontalAlignment.Left

B)ObjectName.Alignment = Left

C)ObectName.Left = True

D)ObjectName.HorizontalAlignment = Left

9
CORRECT Which of the following is the best choice when the user needs to input her social
security number?

A)RichTextBox

B)TextBox

C)MaskedTextBox

D)GroupBox

10
CORRECT You are designing a form and you need a control that will be used for the user to
type a brief summary of his work experience. You want to allow formatting options
and multiple lines. The best control for this task would be a _______.

A)RichTextBox

B)TextBox

C)MaskedTextBox
D)GroupBox

Results Reporter
Out of 10 questions, you answered 7 correctly with a final grade of 70%

7 correct
(70%)
3
incorrect
(30%)
0
unanswe
red (0%)
Your Results:
The correct answer for each question is indicated by a .

1 CORRECT
Labels are used primarily for user input

A)True

B)False

2
INCORRECT TextBoxes can only display a single line of text, but RichTextBoxes can display
text on multiple lines

A)True

B)False

3 CORRECT
A form can contain multiple group boxes

A)True
B)False

4
INCORRECT You are designing a form that will have three groups of radio buttons. You
should create three group boxes, and then create the groups of radio buttons
inside each of the group boxes

A)True

B)False

5 CORRECT
Your project requires the user to choose his or her gender. You should display
the choices, Male and Female, using check boxes

A)True

B)False

6
INCORRECT The default setting for the Checked property of a check box is True

A)True

B)False

7 CORRECT
During design time, you can make a check box appear selected by setting its
Checked property to False

A)True

B)False
8 CORRECT
When a check box is checked, the Checked property is set to True

A)True

B)False

9 CORRECT
The user can select multiple radio buttons in the same group

A)True

B)False

10
CORRECT During run-time, if a radio button is selected, its Checked property is True.

A)True

B)False

With Visual
Basic, you can
write computer
programs that
run in the
Microsoft
Windows
environment

A)True

B)False
2 CORRECT
Visual Basic is an object-oriented programming language

A)True

B)False

3 CORRECT
In Form1.Text, the word Text is referring to a method

A)True

B)False

4 CORRECT
Writing a program in Visual Basic is so easy that it is not necessary to do any
planning

A)True

B)False

5 CORRECT
When creating a project in Visual Basic, you should always begin by writing the
Basic code

A)True

B)False

6
INCORRECT A .vb file is a text file that can be opened with any text editor and it holds the
code procedures that you write

A)True
B)False

7 CORRECT
The .resx file is a text file that defines all resources used by the form including
any graphics that are displayed on the form

A)True

B)False

8 CORRECT
The Properties window is used to set the properties for the objects on your form

A)True

B)False

9
CORRECT The Solution Explorer window is used to design a form that makes up your user
interface

A)True

B)False

10
CORRECT You are in run time when you design the user interface

A)True

B)False
When you
declare a
variable or a
named
constant,
Visual Basic
reserves an
area of
memory and
assigns it a
name called
a(n) _______.

Identifier
A)

Identity
B)

Declaration
C)

Dimension
D)

2 CORRECT
Declaration statements _______.

Can only be written inside a procedure


A)

Are only allowed in the Declarations section of a form


B)
Give variables and constants names, and specify the type of data they will
C) hold

Are not needed for constants


D)

3 CORRECT
Which of the following is NOT a valid Visual Basic data type?

Integer
A)

Real
B)

Decimal
C)

String
D)
4 CORRECT
The data type that is used for decimal fractions is _______.

Decimal
A)

Short
B)

Integer
C)

Fraction
D)

5 CORRECT
Which of the following is NOT a valid rule for naming identifiers?

Names may contain underscores


A)

Names may contain letters


B)

Names may contain digits


C)

Names may contain spaces


D)

6 CORRECT
Which of the following is NOT a rule for naming identifiers?

Identifiers for constants should use an underscore between words


A)

Identifiers should use periods to separate words


B)

Identifiers should list the data type at the end of the name
C)

Identifiers cannot contain embedded blanks


D)

7
INCORRECT The length of identifiers is limited to _______.

1 to 8 characters
A)

1 to 256 characters
B)

1 to 4,000 characters
C)
1 to 16,383 characters
D)

8 CORRECT
Which of the following does not follow the conventions for naming identifiers?

UnitsEnrolledDecimal
A)

ZipCodeString
B)

Amount.Due.Decimal
C)

COUNTRY_OF_BIRTH_String
D)

9
INCORRECT Intrinsic constants are _______.

Declared using the keyword Const


A)

Declared using the keyword Dim


B)

Placed in the Declarations section of a form


C)

Built into Visual Studio


D)

10
INCORRECT Which of the following is NOT a rule for naming identifiers for constants?

Include the data type at the end of the identifier


A)
Everything in the identifier's name should be capitalized except the data
B) type

Identifiers for constants should begin with a prefix of Const


C)

Identifiers for constants should use an underscore between words


D)

A constant
contains data
whose value
may be
changed
during the
execution of a
project

True
A)

False
B)

2 CORRECT
Data whose value may not be changed during the execution of a project is
referred to as a constant

True
A)

False
B)

3 CORRECT
If you are declaring a variable that will be used in calculations, you may use the
string data type

True
A)

False
B)

4 CORRECT
GrandTotalDecimal is a valid variable name

True
A)

False
B)

5 CORRECT
Assume that a variable is declared in the Declarations section of a form and
named TOTAL_PAY_Decimal. This variable, TOTAL_PAY_Decimal, will be visible
to all procedures in that form even though the programmer did not follow the
naming conventions in the textbook and name the variable TotalPayDecimal

True
A)

False
B)
6 CORRECT
When naming a constant, you should use uppercase characters in the name with
an underscore between the words and the data type at the end of the name

True
A)

False
B)

7
INCORRECT SCHOOL_NAME_String is in the correct format for a constant that holds the
name of your school

True
A)

False
B)

8 CORRECT
Constants can store string or numeric values

True
A)

False
B)

9 CORRECT
Numeric constants may contain only the digits ( 0 - 9 ), a decimal point, and a
sign ( + or - ) at the left side

True
A)

False
B)

10
INCORRECT Although it is best to always declare the data type on a Dim statement, the data
type is optional

True
A)

False
B)

In an If
statement,
when the
expression is
true, _______.

Only the Else clause is executed


A)

Only the ElseIf clause is executed


B)

Only the End If statement is executed


C)

Only the Then clause is executed


D)

2 CORRECT
Which of the following is a comparison operator?

And
A)

>
B)

+
C)

&
D)

3
INCORRECT When comparing strings, which one of the following strings is less than the
others, based on the ANSI code?

ONETWOTHREE
A)

onetwothree
B)

OneTwoThree
C)

1Two3
D)

4 CORRECT
______________ will be the result of: MessageText .Text =MessageText
.Text.ToUpper() when the value of MessageText .Text is "Visual Basic is fun!".

Visual Basic is fun!


A)

VISUAL BASIC IS FUN!


B)

visual basic is fun!


C)
VisualBasicisfun!
D)

5 CORRECT
Which of the following is NOT a logical operator?

If
A)

Or
B)

And
C)

Not
D)

6 CORRECT
With the logical operator _______ , both expressions must be true for the entire
expression to evaluate True

And
A)

Or
B)

AndAlso
C)

OrElse
D)

7 CORRECT
With the logical operator _______ , if the first expression is True, the second
expression will not be evaluated.

And
A)

Or
B)

AndAlso
C)

OrElse
D)

8
INCORRECT Which of the following is correct code for determining if a checkbox is checked?
If Senior.Checkbox = True Then
A)

If SeniorCheckBox.Checked = True Then


B)

If SeniorCheckBox.Checked Then
C)

Both answers B and C are correct


D)

9 CORRECT
An If contained within another If statement is _______.

A nested If
A)

A compound expression
B)

An embedded contradiction
C)

Impossible to do in VB
D)

10
CORRECT Nested Ifs are allowed, _______.

But you are limited to only 4 levels of Ifs


A)

But each If must have an End If


B)

Can be difficult to follow if they are nested too deeply


C)

Both answers b and c are correct


D)

In an If
statement,
when the
expression is
false, only the
Else clause, if
present, is
executed

True
A)

False
B)
2 CORRECT
A block of If / Then / Else must begin with an If statement and end with an
EndOfIf statement

True
A)

False
B)

3
INCORRECT In an If / Then / Else statement, the Else clause is optional

True
A)

False
B)

4 CORRECT
The Unified Modeling Language (UML) can be used to nest If statements in code

True
A)

False
B)

5 CORRECT
It's a good idea to always use the ToUpper or ToLower method on the Text
property of text boxes, whenever comparing string values.

True
A)

False
B)

6 CORRECT
Or and And are logical operators used in compound expressions

True
A)

False
B)

7 CORRECT
The AND operator requires that both conditions be True for the compound
expression to be True
True
A)

False
B)

8 CORRECT
The code: If NumberAInteger > NumberBInteger AND NumberBInteger >
NumberCInteger Then, evaluates True when NumberAInteger=3,
NumberBInteger=5, and NumberCInteger=2.

True
A)

False
B)

9
INCORRECT The code: If NumberAInteger > NumberBInteger OR NumberBInteger >
NumberCInteger Then, evaluates True when NumberAInteger=3,
NumberBInteger=5, and NumberCInteger=2

True
A)

False
B)

10
CORRECT If statements containing additional Ifs are said to be nested If statements

True
A)

False
B)

Which of the
following
statements
about menus is
NOT true?

Menu items are displayed in buttons at the top of the window


A)

Create a menu by adding a MenuStrip component to the form


B)
In a menu, submenus will be indicated by a filled triangle to the right of the
C) command

Each item in a menu can have keyboard access


D)
2
INCORRECT Which of the following is NOT true about menu items in Visual Basic?

Menus appear at the top of a window.


A)

Menus can contain keyboard access keys


B)
You can add a separator between menu items by using the Line control from
C) the toolbox

Create a menu using the MenuStrip component


D)

3
INCORRECT Which of the following is NOT true about using keyboard access with a menu
item?

The first menu's Text property should be &File.


A)
Do not use the same access key on a main menu name as you use on a
B) form control
When the program is running, use the Alt key with the letter in the menu
C) that is underlined, in order to access that procedure

Menu items will not function correctly if keyboard access is not assigned
D)

4
INCORRECT Which property in a menu item's property window is used to change the words
that will display in the menu?

Name
A)

Text
B)

Visible
C)

Index
D)

5
INCORRECT Which property of a menu must be set to True if you want an item to have a
check mark next to it when the project runs?

Selected
A)
Enabled
B)

Visible
C)

Checked
D)

6
INCORRECT Which of the following is NOT true about a menu item that has a check mark?

It is currently selected
A)

It can be deselected by changing its Checked property to False


B)

It can be toggled on and off


C)

It is shown in gray
D)

7
INCORRECT Common Dialog Boxes _______.

Allow Visual Basic programs to translate the text on the screen into another
A) language
Display the predefined Windows dialog boxes for open, save, fonts, and
B) colors

Can only be used on forms with menus


C)
Allow you to create message boxes that will pop up and prompt the user for
D) text input

8
INCORRECT Of the following choices, which CANNOT be done with common dialog boxes?

Opening files
A)

Selecting fonts
B)

Selecting colors
C)

Resizing windows
D)
9
INCORRECT Which of the following is not a type of common dialog box?

Color
A)

Save
B)

Edit
C)

Open
D)

10
CORRECT Which of the following is the method for showing common dialog boxes?

ShowDialog
A)

ShowOpen
B)

ShowPrint
C)

ShowColor
D)

When creating
menus with
the MenuStrip
component,
the Name
property is
used to hold
the words that
will appear on
the screen in
the menu bar.

True
A)

False
B)

2
INCORRECT If you click on an item in a menu that is grayed out, you will toggle it on, and it
will appear in black text

True
A)

False
B)
3 CORRECT
By default, all new menu items have their Enabled property set to True

True
A)

False
B)

4 CORRECT
An enabled menu item appears in black text and is available for selection.

True
A)

False
B)

5 CORRECT
When creating a menu, if an item named "Help" is listed, it should be at the far
right and the H should have keyboard access.

True
A)

False
B)

6 CORRECT
If you want the user to be able to use the dialog boxes from the Windows
environment so he can save files and change colors, you will need to add two
common dialog components to your form, the SaveFileDialog for saving files,
and the ColorDialog for changing colors

True
A)

False
B)

7
INCORRECT After adding a common dialog component to a form, you can display a common
dialog box at run time using the OpenDialog method

True
A)

False
B)
8 CORRECT
If you use the ShowDialog method to display a common dialog box, the window
that is displayed is modal

True
A)

False
B)

9 CORRECT
Right-clicking on an object will usually pop up a context menu

True
A)

False
B)

10
CORRECT Functions perform an action and return a value

True
A)

False
B)

When a project
begins, the
first form to
display is
called the
_______.

Startup form
A)

Splash screen
B)

About box
C)

Show dialog
D)

2 CORRECT
In a project with multiple forms, the _____________ form is the first form
loaded into the computer's memory and displayed on the desktop

Default
A)
Startup
B)

About
C)

Splash screen
D)

3
INCORRECT Which of the following statements about forms is NOT true?

You can have just one form in a project


A)

You can add an existing form from another project into your project.
B)

With multiple forms, the startup form must be named MainForm


C)

The number of forms in a project is virtually unlimited


D)

4 CORRECT
In order to add a new blank form to a project, select _______ from the "Project"
menu

Add Windows Form


A)

Add Existing Item


B)

Exclude from Project


C)

All of the above could be used to add a new blank form to a project
D)

5 CORRECT
To add a form from another project into your project, select _______ from the
"Project" menu.

Add Windows Form


A)

Add Existing Item


B)

Add New Item


C)

All of the above could be used to add an existing form to your project
D)
6
INCORRECT You can remove a form from a project by _______.

Selecting the form's name in the Solution Explorer window and clicking the
A) delete key
Writing code in a button on the form that uses the form name and the Close
B) method
Right-clicking on the form's name in the Solution Explorer window and
C) choosing Delete

Both answers A and C would remove a form from a project


D)

7
INCORRECT The _______ is available in most Windows programs and usually displays
information about the program version as well as the company name

Startup form
A)

Login form
B)

About form
C)

Main form
D)

8
INCORRECT The _______ is found in the Project Designer and contains the information about
the program title, program version, programmer, and company.

Splash screen
A)

About box
B)

Startup form
C)

Assembly information
D)

9
INCORRECT The project's assembly information can be retrieved by using the _______
object

My.Startup
A)

My.SplashScreen
B)
My.Application
C)

My.About
D)

10
INCORRECT Professional applications use a(n) _______ to tell the user that the program is
loading and starting

About box
A)

Splash screen
B)

Startup form
C)

Showdialog form
D)

Multiple forms
are allowed in
Visual Basic
projects

True
A)

False
B)

2 CORRECT
Message boxes allow the programmer to be very creative when displaying
summary information and company logos

True
A)

False
B)

3 CORRECT
With a project that uses multiple forms, it is possible to have objects with the
same name, such as ExitButton, on different forms

True
A)

False
B)
4 CORRECT
The number of forms allowed in a Visual Basic project is virtually unlimited

True
A)

False
B)

5 CORRECT
The first form a project displays is called the default form

True
A)

False
B)

6 CORRECT
Add a new form to a project by selecting "Add Windows Form" from the "Project"
menu

True
A)

False
B)

7 CORRECT
Each form is a separate class in the project

True
A)

False
B)

8
INCORRECT Each form is a separate file in the project folder

True
A)

False
B)

9 CORRECT
Forms can be used in multiple projects

True
A)
False
B)

10
CORRECT When copying form files from another project, only copy the file with the .vb file
extension and VB will automatically copy the form files with the Designer.vb
extension and the .resx extension

True
A)

False
B)
Use the
_______
control
from the
toolbox
to create
list boxes
on a form

A) List

B) ListBox

C) ComboBox

D) SimpleList

2
INCORRECT A _______ control contains a text box as part of the control

A) Frame

B) ListBox

C) ComboBox

D) DropDownList

3
CORRECT Which of the following is NOT a style for combo boxes?

A) Simple
B) DropDown

C) DropDownList

D) SimpleList

4 CORRECT List boxes and combo boxes _______.

A) Are created with the same tool from the toolbox

B) Have a Text property during design time

C) Hold a list of values

D) Always have scroll bars

5
CORRECT Items can be added to a list during design time using the _________ collection.

A) AddLists

B) Items

C) ItemsAdd

D) AddItems

6 CORRECT Values for the items in a list _______.


A) Can be entered in the Items collection in the Properties window

B) Can be entered in the Values collection in the Properties window

C) Can be entered in the AddItem collection in the Properties window

D) Must be entered in alphabetical order

7
The data that appears in a combo box when it is first displayed can be added to
CORRECT the combo box _______.

A) Using the Form_Load procedure and the combo box Items.Add method

B) During design time in the Items Collection of the combo box

C) Using the ComboBox.Add () method

D) Answers A and B are correct.

8
CORRECT Items can be added to a list during run time using the _________ method

A) AddLists

B) Lists

C) ItemsAdd

D) Items.Add
9
CORRECT Items in a list can be placed in alphabetical order by _______.

A) Setting the Sorted property to true

Selecting the item in the list and then using the arrow keys to move the
B) item up or down the list

C) Setting the Alphabetize property to true

D) Setting the Index property to 1

10
Which of the following instructions will add the word, monkey, to a list box
CORRECT named AnimalsListBox?

A) AnimalsListBox.Insert(monkey)

B) AnimalsListBox.Insert ("monkey")

C) AnimalsListBox.Items.Add(monkey)

D) AnimalsListBox.Items.Add("monkey")

INCORRECT
To add scroll bars to list boxes and combo boxes you must set the
ScrollAlwaysVisible property to True.

A)True

B)False

2 CORRECT
List boxes have a Text property, but it can only be accessed at run time

A)True
B)False

3
INCORRECT List boxes and combo boxes have a Text property that can be accessed at
design time

A)True

B)False

4
INCORRECT Items are added to a list box during design-time with the ListIndex property.

A)True

B)False

5 CORRECT
It is possible to add values to a list box or combo box during design by using the
Items property

A)True

B)False

6
INCORRECT List boxes and combo boxes can only hold numeric values.

A)True

B)False
7
INCORRECT The Alphabetize property can be set to True and the combo or list box will
automatically be sorted when an item is added to the list.

A)True

B)False

8 CORRECT
The SelectedIndex property can be used to select an item in the list or to
determine which item is selected

A)True

B)False

9 CORRECT
Use the code: NamesListBox.SelectedIndex = -1, to deselect all items in a list

A)True

B)False

10
INCORRECT If a list contains 15 items, the Count property will be 15 and the highest
SelectedIndex property will be 16.

A)True

B)False

The correct answer for each question is indicated by a .

1
INCORRECT An array is a set of variables. Each individual variable is called _______.

A)A subscript
B)An element

C)A subscripted variable

D)An index

2 CORRECT
The individual variables in an array are accessed by their _______, which is
their position in the array

A)Dimension

B)ListCount property

C)Subscript

D)ItemCount property

3
INCORRECT Declare an array and specify the number of elements using _______.

A)The ListCount property

B)The ListIndex property

C)An Array statement

D)A Dim statement

4
INCORRECT How many elements are contained in the array created with the following code?
Dim EmployeeString(25) As String
A)0 (The code is incorrect to create an array.)

B)24

C)25

D)26

5
INCORRECT If an exception is thrown and the message, "Index was outside the bounds of
the array." displays, this indicates _______.

A)The array is completely full of data

The subscript is a value greater than the number of elements declared in the
B)array's Dim statement

The subscript has reached a value lower than the number of elements
C)declared in the array's Dim statement

D)The answer could be B or C.

6
INCORRECT When you are working with an array, the easiest way to traverse the elements is
to use the _______.

A)If / Then statement

B)Next statement

C)For Each / Next statement

D)Case structure
7
INCORRECT In the following statement, _______, refers to the array, For Each
OneSchoolString In SchoolString

A)For Each

B)OneSchoolString

C)In

D)SchoolString

8
INCORRECT A VB programmer can combine multiple fields of related data using a _______.

A)DataType statement

B)Structure statement

C)For Each statement

D)Public statement

9
INCORRECT Given the following code, which of the choices below would be used to access
the phone number of the 3rd vendor? Private Structure Vendor Dim
VendorIDString As String Dim NameString As String Dim PhoneString As String
End Structure Dim BusinessVendor(5) As Vendor

A)BusinessVendor(2).PhoneString

B)Vendor(2).PhoneString

C)PhoneString(2).Vendor
D)BusinessVendor(2)

10
CORRECT Which of the following code samples is valid for accumulating the total sales for
the Tigers baseball club if the Tigers are the second group in the list?

A)SalesDecimal += TotalSalesDecimal(1)

B)SalesDecimal += TotalSalesDecimal(2)

C)TotalSalesDecimal(1) += SalesDecimal

D)TotalSalesDecimal(2) += SalesDecimal

True or False
(See related pages)

Results Reporter

Out of 10 questions, you answered 7 correctly with a final grade of 70%

7 correct
(70%)

3
incorrect
(30%)

0
unanswe
red (0%)

Your Results:
The correct answer for each question is indicated by a .
1 CORRECT
An array is a list or series of values

A)True

B)False

2 CORRECT
An array is a series of values, all referenced by the same variable name

A)True

B)False

3 CORRECT
Sometimes arrays are referred to as list boxes

A)True

B)False

4 CORRECT
Each individual variable in an array is called a "member" of the array
A)True

B)False

5 CORRECT
An array is a series of individual variables, all referenced by the same name but
having unique indexes

A)True

B)False

6 CORRECT
A subscript may also be called an index

A)True

B)False

7
INCORRECT A Dim statement can be used to specify initial values for the array elements
A)True

B)False

8
INCORRECT When an array is initialized with the Dim Statement, the index starts at 1
instead of 0.

A)True

B)False

9 CORRECT
StudentNameString (0) is a valid position in an array that is declared with the
statement: Dim StudentNameString(15) As String.

A)True

B)False

10
INCORRECT The following code is valid for declaring an array with ten elements: Dim
EmployeeNameString(0 to 10).
A)True

B)False
Multiple Choice Questions
51. Which language is not a true object-oriented programming language?
a.) VB.NET
b.) VB 6
c.) C++
d.) C#
e.) Java

Answer: b Level: Easy


Section: 6-1 Page: 107

52. A GUI:
a.) uses buttons, menus, and icons.
b.) should be easy for a user to manipulate.
c.) stands for Graphic Use Interaction.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 6-1 Page: 106

53. Visual Studio .NET provides which feature:


a.) debugging.
b.) application deployment.
c.) syntax checking.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 6-2 Page: 107

54. What does IDE stand for?


a.) Integrated Development Environment
b.) Integrated Design Environment
c.) Interior Development Environment
d.) Interior Design Environment
e.) None of the above.

Answer: a Level: Moderate


Section: 6-2 Page: 107

55. Which type of project can a developer choose in the New Project dialog box?
a.) Visual Basic Projects
b.) Visual C# Projects
c.) Visual C++ Projects
d.) Both a and b.
e.) All of the above.
Answer: e Level: Easy
Section: 6-2 Page: 108

56. Which is not a main component of the Visual Studio IDE?


a.) Solution Explorer
b.) Tool Box
c.) Start Menu
d.) Designer Window
e.) Properties Window

Answer: c Level: Easy


Section: 6-2 Page: 110

57. Which does the solution explorer not display?


a.) Form Properties
b.) Reference Folder
c.) Form File
d.) Assemble File
e.) All are part of the solution explorer.

Answer: a Level: Easy


Section: 6-2 Page: 111

58. Which is true about the name and text property of a control?
a.) They are the same when the control is first created.
b.) The text property changes to match any changes in the name property.
c.) The name property changes to match any changes in the text property.
d.) They are never the same unless the programmer makes it that way.
e.) They are not allowed to be the same and an error will occur if they are.

Answer: a Level: Hard


Section: 6-3 Page: 113

59. For which task does the IDE provide multiple ways to accomplish the task?
a.) Putting a control on the form
b.) Running the program
c.) Activating the property window for a control
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 6-3 Page: 111

60. Which are the standard prefixes for the Button and Combo box controls respectively?
a.) btn and chb
b.) btn and cbo
c.) bto and chb
d.) bto and cbo
e.) cmd and cbo
Answer: b Level: Moderate
Section: 6-3 Page: 113

61. Which are the standard prefixes for the text box and label controls respectively?
a.) tex and lbl
b.) tex and lab
c.) txb and lbl
d.) txb and lab
e.) txt and lab

Answer: c Level: Moderate


Section: 6-3 Page: 113

62. Which task is accomplished in the Code editor?


a.) Adding forms to the project
b.) Adding controls to the form
c.) Adding event procedures to the form
d.) Both a and b.
e.) All of the above.

Answer: c Level: Moderate


Section: 6-3 Page: 115

63. Which is not a feature of a GUI that makes learning a program easy for users?
a.) Online help
b.) WYSIWYG formatting
c.) Dialog boxes
d.) Detailed key strokes and commands
e.) Icons
Answer: d Level: Easy
Section: 6-4 Page: 119

64. An object is composed of:


a.) properties.
b.) methods.
c.) events.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 6-5 Page: 120

65. Which statement about objects is true?


a.) One object is used to create one class.
b.) One class is used to create one object.
c.) One object can create many classes.
d.) One class can create many objects.
e.) There is no relationship between objects and classes.

Answer: d Level: Moderate


Section: 6-5 Page: 120

66. Which is not true about forms and controls in Visual Basic?
a.) They are pre-built.
b.) They are graphical objects.
c.) New versions of the classes must be created with each project.
d.) Buttons can be created with the drag and drop method.
e.) All of the above are true.

Answer: c Level: Moderate


Section: 6-5 Page: 120

67. Which is an example of Visual Basic Objects?


a.) Control objects
b.) ASP.NET
c.) ADO.NET
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 6-5 Page: 120

68. The .Net class library:


a.) contains over 25,000 classes.
b.) uses namespaces to manage all of the classes.
c.) has the System.Form namespace for classes used in Windows-based application.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Hard


Section: 6-5 Page: 120

69. Which is not a property of the Common control class?


a.) Show
b.) BackColor
c.) Font
d.) ForeColor
e.) Name

Answer: a Level: Easy


Section: 6-6 Page: 123

70. Which property determines whether a control is displayed to the user?


a.) Hide
b.) Show
c.) Visible
d.) Enabled
e.) Cursor
Answer: c Level: Hard
Section: 6-6 Page: 123

71. The Button control can be activated:


a.) programmatically through the click event.
b.) by clicking the button with the mouse.
c.) with the form’s DefaultButton property.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 6-6 Page: 124

72. The CancelButton property belongs to which object?


a.) Button
b.) Form
c.) Label
d.) TextBox
e.) Timer

Answer: b Level: Moderate


Section: 6-6 Page: 124

73. A click event procedure stud for the label control can be created by:
a.) selecting the object and event from the code editor window’s drop-down boxes.
b.) typing the code in the code editor window.
c.) by double clicking the control.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 6-7 Page: 126

74. In event-driven programming an event is generated by:


a.) the system.
b.) a user’s action.
c.) the program itself.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 6-7 Page: 125

75. Which is not a common control event?


a.) Click
b.) SingleClick
c.) DoubleClick
d.) MouseMove
e.) MouseDown
Answer: b Level: Easy
Section: 6-7 Page: 125

76. The Tick event is found only in which object?


a.) Form
b.) Button
c.) TextBox
d.) Label
e.) Timer

Answer: e Level: Easy


Section: 6-7 Page: 126

77. The Activated event is found only in which object?


a.) Form
b.) Button
c.) TextBox
d.) Label
e.) Timer

Answer: a Level: Easy


Section: 6-7 Page: 126

78. The Rnd statement will generate a(n):


a.) decimal value between 0.01 and 1.00.
b.) integer value between 0.01 and 1.00.
c.) decimal value between 0.0 and 1.0.
d.) integer value between 0.0 and 1.0.
e.) decimal value between 0.0 and up to 1.0, but not including 1.0.

Answer: e Level: Moderate


Section: 6-7 Page: 127

79. The analysis phase of software development involves:


a.) collecting the requirements about what the program will accomplish.
b.) creating a detailed plan on how the program will accomplish the requirements.
c.) writing the software with a program such as VB.NET.
d.) Both a and b.
e.) All of the above.

Answer: a Level: Moderate


Section: 6-8 Page: 129

80. Which phase of project development typically costs the most?


a.) Analysis
b.) Design
c.) Implementation
d.) Maintenance
e.) Documentation
Answer: d Level: Easy
Section: 6-8 Page: 129

Multiple Choice Questions


51. Which is not an integer data type?
a.) Single
b.) Byte
c.) Short
d.) Integer
e.) Long

Answer: a Level: Moderate


Section: 7-1 Page: 143

52. Which is a numeric data type?


a.) Floating point
b.) Integer
c.) Boolean
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 7-1 Page: 143

53. Which sequence of char data types is listed from lowest to highest?
a.) a, A, z, Z
b.) a, z, A, Z
c.) A, a, Z, z
d.) A, Z, a, z
e.) z, a, Z, A

Answer: d Level: Moderate


Section: 7-1 Page: 145

54. The Date data type does not hold which type of information.
a.) Seconds
b.) Hours
c.) Days
d.) Months
e.) Quarters

Answer: e Level: Easy


Section: 7-1 Page: 145
55. The Boolean data type:
a.) is unsigned.
b.) has two states.
c.) is displayed by the program as yes or no.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 7-1 Page: 144

56. Which is a valid statement for declaring a variable?


a.) Const Form As Integer
b.) Const myForm As Integer
c.) Dim Form As Integer
d.) Dim myForm As Integer
e.) All of the above.

Answer: d Level: Moderate


Section: 7-2 Page: 147

57. VB.Net identifiers:


a.) are case sensitive.
b.) can begin with an underscore.
c.) can begin with a number.
d.) Both a and b.
e.) All of the above.

Answer: b Level: Moderate


Section: 7-2 Page: 147

58. The name of a constant:


a.) must both begin with a letter and be all upper case.
b.) does not have to begin with a letter but must be all upper case.
c.) must begin with a letter but can be upper or lower case.
d.) does not have to begin with a letter and be either upper or lower case.
e.) None of the above.

Answer: d Level: Moderate


Section: 7-2 Page: 148

59. The proper operator precedence, from first to last, is:


a.) logical, comparison, and arithmetic.
b.) arithmetic, comparison, and logical.
c.) arithmetic, logical, and comparison.
d.) comparison, arithmetic, and logical.
e.) logical, arithmetic, comparison.

Answer: b Level: Moderate


Section: 7-3 Page: 151
60. With A = False and B = True, which statement evaluates as True?
a.) A AND A
b.) A AND B
c.) B AND A
d.) B AND B
e.) None are true.

Answer: d Level: Easy


Section: 7-3 Page: 151

61. With A = False and B = True, which statement evaluates as False?


a.) A OR A
b.) A OR B
c.) B OR A
d.) B OR B
e.) None are true.

Answer: a Level: Easy


Section: 7-3 Page: 151

62. Which operator is evaluated first?


a.) NOT
b.) AND
c.) XOR
d.) OR
e.) They are always evaluated left-to-right.

Answer: a Level: Moderate


Section: 7-3 Page: 151

63. The left side of an assignment statement will hold:


a.) a variable.
b.) an object property.
c.) an expression.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Easy


Section: 7-4 Page: 152

64. The right side of an assignment statement will hold:


a.) a variable.
b.) an object property.
c.) an expression.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Easy


Section: 7-4 Page: 152
65. Which function will return the monthly payments of a loan?
a.) Pay (Rate, PV, Nper)
b.) Pmt (Rate, Nper, PV)
c.) FV (Rate, Nper, Pmt)
d.) FV (Rate, Nper, PV)
e.) None of the above.

Answer: b Level: Easy


Section: 7-5 Page: 154

66. Which function returns the numbers represented in the string “$56.7”?
a.) Abs
b.) CDbl
c.) Int
d.) Rnd
e.) Val

Answer: b Level: Moderate


Section: 7-5 Page: 153

67. What will the function Val ($165.30) return?


a.) 0
b.) 165
c.) 165.30
d.) $165.30
e.) An error

Answer: a Level: Easy


Section: 7-5 Page: 153

68. Which function displays a pop-up window?


a.) MsgBox
b.) InputBox
c.) TextBox
d.) Both a and b.
e.) All of the above.

Answer: d Level: Easy


Section: 7-6 Page: 156

69. Which is true about the prompt argument?


a.) It can be made of multiple values concatenated into one string.
b.) It can include the vbCrLf constant.
c.) It can include the ampersand symbol to concatenate strings.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 7-6 Page: 157
70. In order to process a number typed in a TextBox the programmer must:
a.) use the Val function to convert the Text value.
b.) use the CDbl function to convert the Text value.
c.) use the IsNumeric function to convert the Text value.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 7-7 Page: 158

71. Which TextBox method does not use the clipboard?


a.) Clear
b.) Copy
c.) Cut
d.) Paste
e.) All of these methods use the clipboard.

Answer: a Level: Easy


Section: 7-7 Page: 159

72. Which TextBox property should always be changed first?


a.) AcceptsReturn
b.) BorderStyle
c.) Font
d.) Name
e.) Text

Answer: d Level: Moderate


Section: 7-7 Page: 158

73. Which is not a valid value for the ListBox SectionMode Property?
a.) None
b.) One
c.) MultiSimple
d.) MultiExtended
e.) All of the above.

Answer: e Level: Moderate


Section: 7-8 Page: 160

74. Setting the SelectedIndex property of a ListBox to -1 will:


a.) cause an error.
b.) cannot be done.
c.) de-select any selected item.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Hard


Section: 7-8 Page: 160
75. Which method of a ListBox will remove just one item at a time?
a.) Items.RemoveAt
b.) Item.RemoveAt
c.) Items.ClearAt
d.) Item.ClearAt
e.) Items.Clear

Answer: a Level: Moderate


Section: 7-8 Page: 160

76. The Items property of a ComboBox:


a.) is a collection of items.
b.) is the same as the Items property of a ListBox.
c.) contains methods and properties.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 7-9 Page: 162

77. Which value for the ComboBox DropDownStyle property allows a user to type in data?
a.) DropDown
b.) DropDownSimple
c.) DropDownList
d.) Both a and b.
e.) All of the above.

Answer: a Level: Moderate


Section: 7-9 Page: 164

78. Which two controls combined to form the ComboBox control?


a.) ListBox and TextBox
b.) ListBox and InputBox
c.) ListBox and MsgBox
d.) Label and TextBox
e.) Label and InputBox

Answer: a Level: Easy


Section: 7-9 Page: 162

Multiple Choice Questions


44. When a condition in an If…Then statements tests true:
a.) the next Else statement is activated.
b.) the next If statement is activated.
c.) the next Then statement is activated.
d.) the End If statement is activated.
e.) a condition can never test true.
Answer: c Level: Moderate
Section: 8-1 Page: 176

45. The End If statement is required:


a.) in all If…Then statements.
b.) in all Multi-line statements with Else.
c.) in Single Line statements.
d.) Both a and b.
e.) All of the above.

Answer: b Level: Moderate


Section: 8-1 Page: 177

46. Which statements are optional in an If…Then statement?


a.) If
b.) Then
c.) Else
d.) Both a and b.
e.) All of the above.

Answer: c Level: Easy


Section: 8-1 Page: 177

47. Which selection process is an example of multiple branches from a single expression?
a.) If…Then
b.) Select Case
c.) Do…Loop
d.) For…Next
e.) All of the above.

Answer: b Level: Hard


Section: 8-2 Page: 179

48. How many times is the test expression of a Select Case evaluated?
a.) 0
b.) 1
c.) 2
d.) Once for each Case.
e.) It depends on the value of the test expression.

Answer: b Level: Moderate


Section: 8-2 Page: 180
49. Which is not a type of Select Case test construct?
a.) simple value
b.) complex value
c.) relational value with Is
d.) range of values with To
e.) All of the above are types of test constructs.

Answer: b Level: Hard


Section: 8-2 Page: 180

50. What happens in a Select Case construct when a test value matches the test expression?
a.) The corresponding block of statements is run.
b.) The next Case test value is checked.
c.) The Case Else statement is run.
d.) The Select Case construct is exited.
e.) An error is generated.

Answer: a Level: Moderate


Section: 8-2 Page: 180

51. Do...Loop is an iterative statement because it:


a.) selects a block of statements to run.
b.) runs the same block of statements repeatedly.
c.) selects a block of statements and runs it repeatedly.
d.) selects a block of statements and runs it a specified number of times.
e.) All of the above.

Answer: b Level: Hard


Section: 8-3 Page: 181

52. Which is true of a Do…Loop?


a.) The While condition goes after the Do keyword.
b.) The Until condition goes after the Do keyword.
c.) The While condition goes after the Loop keyword.
d.) The Until condition goes after the Loop keyword.
e.) All of the above.

Answer: e Level: Easy


Section: 8-3 Page: 181

53. Which Do…Loop statement should be used to process test scores where a test score over
100 is a signal to stop the processing?
a.) Do While Score > 100
b.) Do Until Score > 100
c.) Loop While Score > 100
d.) Loop Until Score > 100
e.) All of the above are valid for this situation.

Answer: b Level: Hard


Section: 8-3 Page: 182

54. In the For…Next statement the default value for the Step is:
a.) -1
b.) 0
c.) 1
d.) 2
e.) There is no default for the step value.

Answer: c Level: Easy


Section: 8-4 Page: 184

55. The For…Next Loop is used when:


a.) a choice is made based on a Boolean condition.
b.) a block of statements is executed an unknown number of times.
c.) a block of statements is executed a known number of times.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Easy


Section: 8-4 Page: 184

56. The advantage of For…Next loops over Do…Loops is that they are:
a.) easier to read and maintain.
b.) less prone to being infinite loops.
c.) good for working with arrays.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 8-4 Page: 185

57. Which is not a valid Exit statement?


a.) Exit Do
b.) Exit For
c.) Exit Form
d.) Exit Select
e.) Exit Sub

Answer: c Level: Moderate


Section: 8-5 Page: 187

58. A sentinel value:


a.) is used to prevent infinite loops.
b.) must be a negative value.
c.) signals the end of a list of data.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Easy


Section: 8-5 Page: 187

59. Which function should be used to validate that input is not a string before performing
arithmetic operations?
a.) IsArithmetic
b.) IsNotString
c.) IsNumeric
d.) IsString
e.) IsValue

Answer: c Level: Moderate


Section: 8-5 Page: 189

60. Which is not a type of error programmers look for?


a.) Logic
b.) Runtime
c.) Superficial
d.) Syntax
e.) All are errors programmers look for.

Answer: c Level: Easy


Section: 8-6 Page: 190

61. Which action will raise an exception?


a.) Dividing by zero.
b.) Assigning the string “Hi” to an integer variable.
c.) Accessing an empty CD drive.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 8-6 Page: 190

62. An Exception is another name for a:


a.) compile error.
b.) logic error.
c.) runtime error.
d.) superficial error.
e.) syntax error.

Answer: c Level: Moderate


Section: 8-6 Page: 190

63. What is the most number of states a CheckBox can have?


a.) 0
b.) 1
c.) 2
d.) 3
e.) 4
Answer: d Level: Moderate
Section: 8-7 Page: 193

64. What is the standard prefix for the name of a CheckBox?


a.) chb
b.) chk
c.) ckb
d.) ckx
e.) cbx

Answer: b Level: Easy


Section: 8-7 Page: 193

65. A CheckBox can also appear as a(n):


a.) button.
b.) RadioButton.
c.) ScrollBar.
d.) Both a and b.
e.) All of the above.

Answer: a Level: Easy


Section: 8-7 Page: 195

66. What is the standard prefix for the name of a RadioButton?


a.) rad
b.) rab
c.) rdo
d.) rdb
e.) rbt

Answer: a Level: Easy


Section: 8-8 Page: 195

67. How many RadioButtons in a Group Box can be selected at the same time?
a.) 0
b.) 1
c.) 2
d.) 3
e.) 4

Answer: b Level: Easy


Section: 8-8 Page: 195

68. Which event is activated when a RadioButton is selected?


a.) Checked
b.) CheckedChanged
c.) Selected
d.) SelectedChanged
e.) SelectionChanged

Answer: b Level: Moderate


Section: 8-8 Page: 196

Multiple Choice Questions


51. Which is a type of procedure found in VB.Net?
a.) Event
b.) Function
c.) Sub
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 9-1 Page: 212

52. The methodology where code is broken into small, logical procedures is called:
a.) event-driven programming.
b.) functional programming.
c.) granular programming.
d.) modular programming.
e.) procedural programming.

Answer: d Level: Hard


Section: 9-1 Page: 212

53. When using a procedure the calling code sends data via the:
a.) actual argument to the formal parameter of the procedure.
b.) formal argument to the actual parameter of the procedure.
c.) actual parameter to the formal argument of the procedure.
d.) formal parameter to the actual argument of the procedure.
e.) All of the above.

Answer: a Level: Hard


Section: 9-1 Page: 212

54. From how many places in the code can a procedure be called?
a.) 0
b.) 1
c.) 2
d.) 3
e.) As many times as needed.

Answer: e Level: Easy


Section: 9-1 Page: 212

55. Which parameter is found in an event procedure?


a.) e
b.) Sender
c.) Receiver
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 9-2 Page: 213

56. Which is an optional element of an event procedure?


a.) End Sub
b.) Handles
c.) Object_Event
d.) Statements
e.) Sub

Answer: d Level: Moderate


Section: 9-2 Page: 213

57. What happens when a parameter in a procedure is declared ByVal?


a.) Only arguments of numeric data types are allowed.
b.) A reference to the argument is sent to the procedure.
c.) A copy of the argument is sent to the procedure.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Easy


Section: 9-2 Page: 213

58. Which is a valid way to write the procedure stub for an object’s default event?
a.) Use the Class and Method combo boxes in the Code Editor window.
b.) Double click on the object in the Form Designer window.
c.) Type the procedure declaration in the Code Editor window.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 9-2 Page: 214

59. A sub procedure is valuable because it:


a.) makes code easier to maintain.
b.) splits the logic to solve a problem into small, manageable units.
c.) limits the number of times the code can be accessed.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 9-3 Page: 214

60. Which is not an optional element of a sub procedure declaration?


a.) Parameters
b.) Public
c.) Private
d.) Statements
e.) Sub

Answer: e Level: Moderate


Section: 9-3 Page: 215

61. Which is a valid way to write a sub procedure declaration?


a.) Use the Class and Method combo boxes in the Code Editor window.
b.) Double click on the object in the Form Designer window.
c.) Type the procedure declaration in the Code Editor window.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Moderate


Section: 9-3 Page: 215

62. Which statement will send the value generated by a function procedure, called
CalculateTax, back to the calling code?
a.) Return Sales*0.08
b.) CalculateTax = Sales*0.08
c.) Return CalculateTax (Sales*0.08)
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 9-4 Page: 217

63. Which part of a function procedure declaration statement is optional?


a.) Datatype
b.) Function
c.) Parameters
d.) Private
e.) ProcedureName

Answer: c Level: Hard


Section: 9-4 Page: 217

64. How many return statements are allowed in a Function Procedure?


a.) 0
b.) 1
c.) 2
d.) 3
e.) There is no limit.

Answer: e Level: Easy


Section: 9-4 Page: 217

65. Why should a variable not be declared as a module variable?


a.) It prevents a procedure from being self contained.
b.) It makes it easier to document the code.
c.) Local variable names can be reused in other procedures.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 9-5 Page: 219

66. Which variable name uses a standard naming convention for module variables?
a.) mWeight
b.) mdWeight
c.) modWeight
d.) moduleWeight
e.) module_Weight

Answer: a Level: Easy


Section: 9-5 Page: 218

67. The scope of a variable refers to:


a.) the length of the variable.
b.) the name of the variable.
c.) the accessibility of the variable.
d.) the datatype of the variable.
e.) the lifetime of the variable.

Answer: c Level: Moderate


Section: 9-5 Page: 218

68. What is the value of the index for the first element in a VB.NET array?
a.) 0
b.) 1
c.) 2
d.) 3
e.) Depends on what the assigned value is.

Answer: a Level: Moderate


Section: 9-6 Page: 219

69. Which method will return the number of elements in an array?


a.) Dimension
b.) Length
c.) Number
d.) Size
e.) UpperBound

Answer: b Level: Moderate


Section: 9-6 Page: 219

70. In the statement, Dim Days(7) as String, what part of the array does the number 7 refer
to?
a.) Array name
b.) Datatype
c.) Lowerbound
d.) Upperbound
e.) Size

Answer: d Level: Moderate


Section: 9-6 Page: 220

71. What is required to reference an element in an array?


a.) Array name
b.) Index value of the element
c.) Element value
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 9-6 Page: 220

72. Which method will arrange the elements of an array in alphabetical order?
a.) Arrange
b.) Assemble
c.) Order
d.) Rank
e.) Sort

Answer: e Level: Easy


Section: 9-6 Page: 222

73. The number of variables allowed in a structured is:


a.) 0
b.) 1
c.) 2
d.) 3
e.) Any number of variables can be declared in an array.

Answer: e Level: Easy


Section: 9-7 Page: 226

74. The variable inside a structure is called a(n):


a.) associate.
b.) constituent.
c.) element.
d.) member.
e.) part.

Answer: d Level: Moderate


Section: 9-7 Page: 226

75. Which datatype can an array not hold?


a.) TextBoxes
b.) Labels
c.) Structures
d.) Controls
e.) An array can hold all of the above.

Answer: e Level: Easy


Section: 9-8 Page: 228

76. An array of controls can be populated by:


a.) assigning existing controls to the array.
b.) creating controls and assigning them to the array.
c.) borrowing controls that will automatically assign them to the array.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 9-8 Page: 228

77. The Tag property can:


a.) only hold string values.
b.) only hold integer values.
c.) only hold Boolean values.
d.) only hold controls.
e.) hold any data defined by the programmer.

Answer: e Level: Hard


Section: 9-8 Page: 228

78. The KeyPress event will capture pressing the key:


a.) A.
b.) shift.
c.) control.
d.) Both a and b.
e.) All of the above.

Answer: a Level: Easy


Section: 9-9 Page: 233

79. Which argument in the KeyPress parameter list contains the Handled property?
a.) Sender
b.) e
c.) Object
d.) KeyPressEventArgs
e.) None of the above.

Answer: b Level: Hard


Section: 9-9 Page: 233

Multiple Choice Questions


41. Which menu item is not typically found in the File Menu?
a.) Close
b.) Copy
c.) Exit
d.) Print
e.) Save

Answer: b Level: Easy


Section: 10-1 Page: 250

42. What is the name of the control for putting menus on a form?
a.) FormMenu
b.) MenuForm
c.) MenuControl
d.) MainMenu
e.) Menu

Answer: d Level: Easy


Section: 10-1 Page: 251

43. The standard prefix for a menu item is:


a.) men.
b.) meu.
c.) mit.
d.) mni.
e.) mnu.

Answer: e Level: Easy


Section: 10-1 Page: 254

44. Which menu object property places a check mark in the display of the menu text?
a.) Check
b.) Checked
c.) CheckMark
d.) CheckOn
e.) RadioCheck

Answer: b Level: Moderate


Section: 10-1 Page: 253

45. Which symbol creates an access key in the text of a menu item?
a.) @
b.) #
c.) $
d.) %
e.) &

Answer: e Level: Moderate


Section: 10-1 Page: 252

46. Which is not a standard dialog box?


a.) ColorDialog
b.) FontDialog
c.) OpenDialog
d.) PrintDialog
e.) ZoomDialog

Answer: e Level: Easy


Section: 10-2 Page: 255

47. Why are standard dialog boxes used?


a.) They are easy to create.
b.) They provide functionality familiar to users.
c.) Developers can create their own versions of Dialog boxes.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 10-2 Page: 255

48. How are dialog boxes implemented in a program?


a.) A dialog box is generated programmatically.
b.) A dialog control is placed in the component tray.
c.) A dialog control is placed on the form.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 10-2 Page: 255

49. The standard prefix for a dialog control is:


a.) dal.
b.) dia.
c.) dil.
d.) dlc.
e.) dlg.

Answer: e Level: Easy


Section: 10-3 Page: 257

50. What is the method used to activate the color dialog box?
a.) ActivateDialog
b.) DisplayDialog
c.) ExhibitDialog
d.) ShowDialog
e.) StartDialog

Answer: d Level: Moderate


Section: 10-3 Page: 256

51. The name of the class used to programmatically create a color dialog box is:
a.) Color
b.) ColorBox
c.) ColorDialog
d.) ColorDisplay
e.) ColorDisplayBox

Answer: c Level: Moderate


Section: 10-3 Page: 257

52. The name of the class used to programmatically create a font dialog box is:
a.) Font.
b.) FontBox.
c.) FontDialog.
d.) FontDisplay.
e.) FontDialogBox.

Answer: c Level: Moderate


Section: 10-3 Page: 258

53. Which OpenFileDialog control property specifies the choices in the “Files of type”
dropdown box?
a.) FileName
b.) FileNames
c.) FileType
d.) Filter
e.) FilterIndex

Answer: d Level: Moderate


Section: 10-4 Page: 258

54. Which property is the same in the OpenFileDialog and the SaveFileDialog control?
a.) FileName
b.) Filter
c.) InitialDirectory
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 10-4 Page: 259

55. Which method is found in both the StreamReader and StreamWriter class?
a.) Close
b.) Peak
c.) Flush
d.) Both a and b.
e.) All of the above.

Answer: a Level: Easy


Section: 10-4 Page: 259

56. The StreamReader and StreamWriter class are both subclasses of which class?
a.) IO
b.) Stream
c.) StreamIO
d.) Both a and b.
e.) All of the above.

Answer: b Level: Hard


Section: 10-4 Page: 260

57. Which dialog control allows the user to zoom in on a document?


a.) PrintDialog
b.) PrintPreview
c.) PageSetupDialog
d.) Both a and b.
e.) All of the above.

Answer: b Level: Moderate


Section: 10-5 Page: 262

58. Which dialog control has a Document property?


a.) PrintDialog
b.) PrintPreview
c.) PageSetupDialog
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 10-5 Page: 264

59. Which object must be assigned to the Document property?


a.) Document
b.) DocumentPage
c.) DocumentPrint
d.) PageDocument
e.) PrintDocument

Answer: e Level: Hard


Section: 10-5 Page: 262

60. When is the PrintPage event activated?


a.) When the PrintDialog control is displayed.
b.) When an assignment is made to the Document property.
c.) The first time the Print method is called.
d.) Every time a page is printed after the Print method is called.
e.) None of the above.

Answer: d Level: Moderate


Section: 10-5 Page: 262

61. Which controls can activate the PrintPage event?


a.) PrintDialog
b.) PrintPreview
c.) PageSetupDialog
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 10-5 Page: 263

62. Which type of file can be played with the Windows Media Player control?
a.) MPEG
b.) AVI
c.) WAV
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 10-6 Page: 265

63. The Windows Media Player control:


a.) is located in the toolbox by default.
b.) is located in the toolbar.
c.) can be added to the toolbar.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Moderate


Section: 10-6 Page: 265

64. The Windows Media Player control can:


a.) display video output.
b.) create audio output.
c.) generate tactile output.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 10-6 Page: 265

65. Which Windows Media Player control property will hide the player from user's view?
a.) Anchor
b.) FileName
c.) Location
d.) ShowControl
e.) Visible

Answer: e Level: Moderate


Section: 10-6 Page: 266

Multiple Choice Questions


46. Where is a single element of data stored?
a.) Field
b.) Record
c.) Table
d.) Both a and b.
e.) All of the above.

Answer: a Level: Easy


Section: 11-1 Page: 287

47. Where is a collection of related data elements stored?


a.) Field
b.) Record
c.) Table
d.) Both a and b.
e.) All of the above.

Answer: b Level: Easy


Section: 11-1 Page: 287
48. Which is true about the primary key?
a.) Every table should have a primary key.
b.) A primary key exclusively identifies each row in a table.
c.) A primary key can be made of multiple fields.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 11-1 Page: 287

49. A foreign key:


a.) has nothing to do with the primary key.
b.) has different values than the primary key.
c.) is found in tables that don’t have a primary key.
d.) is related to the primary key of a different table.
e.) is a unique record in a table.

Answer: d Level: Hard


Section: 11-1 Page: 287

50. Which is not a program that can create a database?


a.) Access
b.) MySQL
c.) Oracle
d.) SQL Server
e.) All of the above can be used to create a database.

Answer: e Level: Easy


Section: 11-1 Page: 288

51. What does the term DBMS stand for?


a.) Database Management Schema
b.) Database Management Style
c.) Database Management System
d.) Database Manipulation Schema
e.) Database Manipulation Style

Answer: c Level: Moderate


Section: 11-1 Page: 288

52. The normalization process is:


a.) used to remove redundant data.
b.) used to make the storage of data more efficient.
c.) not recommended for most databases.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Hard


Section: 11-1 Page: 289
53. Which clause is required in an SQL query for getting information from a database?
a.) JOIN
b.) ON
c.) ORDER BY
d.) SELECT
e.) WHERE

Answer: d Level: Moderate


Section: 11-2 Page: 289

54. How many fields can be specified in the SELECT clause?


a.) 0
b.) 1
c.) 2
d.) 3
e.) As many as needed.

Answer: e Level: Moderate


Section: 11-2 Page: 290

55. How many records are specified in the SELECT clause?


a.) 0
b.) 1
c.) 2
d.) 3
e.) As many as needed.

Answer: a Level: Hard


Section: 11-2 Page: 290

56. Which is the wildcard symbol for selecting all the fields in a table?
a.) @
b.) #
c.) ^
d.) *
e.) +

Answer: d Level: Easy


Section: 11-2 Page: 290

57. The WHERE clause is used to restrict the number of ____ retrieved by an SQL statement.
a.) fields
b.) records
c.) tables
d.) Both a and b.
e.) All of the above.

Answer: b Level: Easy


Section: 11-2 Page: 291

58. Which is not a valid type of JOIN?


a.) LEFT JOIN
b.) MIDDLE JOIN
c.) RIGHT JOIN
d.) INNER JOIN
e.) All of the above are valid types.

Answer: b Level: Moderate


Section: 11-2 Page: 293

59. The ORDER BY clause is used to sort:


a.) fields.
b.) records.
c.) tables.
d.) Both a and b.
e.) All of the above.

Answer: b Level: Moderate


Section: 11-2 Page: 291

60. Which database is the ADO.NET SqlConnection object designed for?


a.) Access
b.) Microsoft SQL Server
c.) MySQL
d.) Oracle
e.) None of the above.

Answer: b Level: Easy


Section: 11-3 Page: 294

61. Which property of the database must the connection object contain?
a.) Location
b.) Type
c.) Query
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 11-3 Page: 294

62. Which is not a tab on the DataLink Property window?


a.) Advanced
b.) All
c.) Adapter
d.) Connection
e.) Provider

Answer: c Level: Hard


Section: 11-3 Page: 296

63. What information is specified in the Connection tab of the DataLink window?
a.) Database login
b.) Database name
c.) Database type
d.) Both a and b.
e.) All of the above.

Answer: d Level: Hard


Section: 11-3 Page: 297

64. The first step of configuring a DataAdapter is to select:


a.) an adapter object.
b.) a connection object.
c.) a database object.
d.) a dataset object.
e.) None of the above.

Answer: b Level: Moderate


Section: 11-3 Page: 298

65. Which DataAdapter Query Type can be used with the Access database?
a.) Use SQL statements.
b.) Create new stored procedure.
c.) Use existing stored procedure.
d.) Both a and b.
e.) All of the above.

Answer: a Level: Easy


Section: 11-3 Page: 299

66. Which is not an ADO.NET DataAdapter Object?


a.) OleDbDataAdapter
b.) SQLDataAdapter
c.) QueryDataAdapter
d.) Both a and b.
e.) All of the above.

Answer: c Level: Easy


Section: 11-3 Page: 299

67. Which is the appropriate prefix for a DataAdapter object?


a.) da
b.) daa
c.) dad
d.) dt
e.) dta

Answer: a Level: Easy


Section: 11-3 Page: 300

68. Which type of object has the Generate Dataset method?


a.) Adapter object
b.) Connection object
c.) Database object
d.) Dataset object
e.) None of the above.

Answer: a Level: Moderate


Section: 11-3 Page: 300

69. Which is the appropriate prefix for a Dataset object?


a.) da
b.) das
c.) dat
d.) ds
e.) dst

Answer: d Level: Easy


Section: 11-3 Page: 300

70. Which object does the data-aware control bind to?


a.) Dataset
b.) DataAdapter
c.) Connection
d.) Both a and b.
e.) All of the above.

Answer: a Level: Easy


Section: 11-4 Page: 300

71. What is the proper code to put data into the dataset called CustomerDataset using the
CustomerDataAdapter object?
a.) CustomerDataset.Fill(CustomerDataAdapter)
b.) CustomerDataAdapter.Fill(CustomerDataset)
c.) CustomerDataset.Load(CustomerDataAdapter)
d.) CustomerDataAdapter.Load(CustomerDataset)
e.) None of the above.

Answer: b Level: Moderate


Section: 11-4 Page: 303
72. Which object contains the Position property of the current record in a dataset?
a.) BindingContext
b.) BindingData
c.) DataBinding
d.) DataBound
e.) DataContext

Answer: a Level: Moderate


Section: 11-4 Page: 303

73. The first record in a dataset has a position property of:


a.) zero.
b.) one.
c.) any value defined by the programmer.
d.) Both a and b.
e.) All of the above.

Answer: a Level: Easy


Section: 11-4 Page: 303

74. Which below is specified by the DataMember Property?


a.) Connection object
b.) DataAdapter object
c.) Database field
d.) Database table
e.) Dataset object

Answer: d Level: Moderate


Section: 11-5 Page: 305

75. Which below is specified by the DataSource Property?


a.) Connection object
b.) DataAdapter object
c.) Database field
d.) Database table
e.) Dataset object

Answer: e Level: Moderate


Section: 11-5 Page: 305

76. Which is a property of the DataGrid control?


a.) DataMember
b.) DataSource
c.) DataQuery
d.) Both a and b.
e.) All of the above.

Answer: d Level: Easy


Section: 11-5 Page: 305
Multiple Choice Questions
41. HTML stands for:
a.) Huge Makeup Language.
b.) Huge Text Makeup Language.
c.) Hypertext Makeup Language.
d.) Hypertext Markup Language.
e.) None of the above.

Answer: d Level: Easy


Section: 12-1 Page: 320

42. Which symbol is used to enclose HTML tags?


a.) ( )
b.) < >
c.) [ ]
d.) { }
e.) None of the above.

Answer: b Level: Easy


Section: 12-1 Page: 320

43. Which symbol identifies an HTML end tag?


a.) !
b.) |
c.) /
d.) \
e.) ?

Answer: c Level: Moderate


Section: 12-1 Page: 320

44. Which HTML tag does not use an end tag?


a.) B
b.) center
c.) HR
d.) I
e.) U

Answer: c Level: Moderate


Section: 12-1 Page: 321

45. Which statement is not true?


a.) An HTML document can be displayed in any internet browser.
b.) HTML is used to change the formatting of the displayed text.
c.) An HTML document is created with an HTML development editor.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Moderate


Section: 12-1 Page: 321

46. Which HTML tag creates a link to another browser page?


a.) A href
b.) A ref
c.) An href
d.) An ref
e.) href

Answer: a Level: Hard


Section: 12-1 Page: 321

47. Which type of computer should host a web server?


a.) Apple
b.) IBM
c.) Sun
d.) UNIX
e.) Any type can host a web server.

Answer: e Level: Easy


Section: 12-2 Page: 322

48. Where does a web application reside?


a.) Web client
b.) Web server
c.) Visual Studio .NET
d.) Both a and b.
e.) All of the above.

Answer: b Level: Moderate


Section: 12-2 Page: 322

49. Which is an example of a web document?


a.) Server script
b.) Web page
c.) Client browser
d.) Both a and b.
e.) All of the above.

Answer: d Level: Hard


Section: 12-2 Page: 322

50. Which is an advantage of using a Web application to deliver an Information System


solution?
a.) Most end users are familiar with using an internet browser.
b.) Web applications are platform independent.
c.) Upgrading the application is not very costly.
d.) Both a and b.
e.) All of the above.
Answer: e Level: Easy
Section: 12-2 Page: 323

51. A postback occurs when:


a.) a browser posts a form to the server.
b.) a user’s action activates the handing of a server event.
c.) a server posts a form to the client.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 12-2 Page: 323

52. When does a “round trip” start in a web application?


a.) The server requests an action from the user.
b.) The user activates a server control event.
c.) The browser posts a form to the server.
d.) The server processes a control event.
e.) The server posts a new HTML page.

Answer: b Level: Hard


Section: 12-2 Page: 323

53. Which software can be used to create an HTML page?


a.) Notepad
b.) Word
c.) Visual Studio .NET
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 12-3 Page: 324

54. Which set of symbols are used to signify the presence of ASP.NET code?
a.) <@
b.) <#
c.) <$
d.) <%
e.) <&

Answer: d Level: Moderate


Section: 12-3 Page: 324

55. Which is the file extension used for an ASP.NET file?


a.) asn
b.) asp
c.) aspn
d.) aspx
e.) asx
Answer: d Level: Easy
Section: 12-3 Page: 325

56. When an ASP.NET file is placed on an IIS server and viewed through a browser, the
resulting HTML page contains:
a.) all ASP.NET code.
b.) as much ASP.NET code as is in the ASP.NET file.
c.) a mix of ASP.NET and HTML code.
d.) all HTML code.
e.) None of the above.

Answer: d Level: Moderate


Section: 12-3 Page: 326

57. What is the extension for a Visual Basic web form interface file?
a.) .asp
b.) .aspx
c.) .asp.vb
d.) .aspx.vb
e.) .asp.vb.net

Answer: b Level: Easy


Section: 12-4 Page: 327

58. What is the extension for a Visual Basic web form code file?
a.) .asp
b.) .aspx
c.) .asp.vb
d.) .aspx.vb
e.) .asp.vb.net

Answer: d Level: Easy


Section: 12-4 Page: 327

59. Which user action will not generate a server-side event?


a.) Mouse Move
b.) Text Change
c.) Button Click
d.) Both a and b.
e.) All of the above.

Answer: a Level: Moderate


Section: 12-4 Page: 327

60. Because of the latency of a round-trip on the internet:


a.) the interface and code of a web form are stored in separate files.
b.) only some user actions, such as button clicks, will generate events.
c.) it is best to use server-side control.
d.) web applications should be coded in Visual Basic.
e.) None of the above.
Answer: b Level: Hard
Section: 12-4 Page: 327

61. Which property is used to name a web control?


a.) ControlName
b.) Designation
c.) ID
d.) Name
e.) Title

Answer: c Level: Moderate


Section: 12-4 Page: 330

62. Which language is used to create an ASP.NET code file?


a.) Visual Basic
b.) C#
c.) C++
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 12-4 Page: 331

63. It is best to use a web instead of a windows application when the application:
a.) has a thin front end (client).
b.) needs to be available to the public.
c.) must be platform-independent.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 12-4 Page: 332

Multiple Choice Questions


31. Which is not a fundamental service identified in a three-tier architecture?
a.) Association layer
b.) Connection layer
c.) Logical layer
d.) Both a and b.
e.) All of the above.

Answer: e Level: Moderate


Section: 13-1 Page: 345

32. Which layer is exemplified by a web server?


a.) Application
b.) Association
c.) Data
d.) Logical
e.) Presentation

Answer: a Level: Easy


Section: 13-1 Page: 345

33. Which layer is exemplified by a fat client?


a.) Application
b.) Association
c.) Data
d.) Logical
e.) Presentation

Answer: e Level: Moderate


Section: 13-1 Page: 345

34. Which layer is exemplified by the use of ADO.NET?


a.) Application
b.) Association
c.) Data
d.) Logical
e.) Presentation

Answer: c Level: Moderate


Section: 13-1 Page: 345

35. How will using a middle tier typically affect the number of connections to a database?
a.) Increase the number
b.) Have no effect on the number
c.) Decrease the number
d.) It depends on the type of client.
e.) It depends on the type of database.

Answer: c Level: Hard


Section: 13-1 Page: 345

36. An application layer:


a.) will contain business logic.
b.) manage connections to the database.
c.) can be distributed over many computers.
d.) Both a and b.
e.) All of the above.
Answer: e Level: Moderate
Section: 13-1 Page: 345

37. A data layer is responsible for:


a.) retrieving information from a database.
b.) updating information in a database.
c.) deleting information in a database.
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 13-1 Page: 345

38. What is the minimum number of computers in a three-tier architecture?


a.) 0
b.) 1
c.) 2
d.) 3
e.) 4 or more

Answer: b Level: Easy


Section: 13-1 Page: 346

39. A server farm is:


a.) an example of a distributed application.
b.) makes it easy to add new computers if demand increases.
c.) applies only to web servers.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 13-1 Page: 346

40. Which is a valid type of state management for the creation of web pages?
a.) Client side
b.) Server side
c.) Data side
d.) Both a and b.
e.) All of the above.

Answer: d Level: Easy


Section: 13-2 Page: 346

41. The stateless HTTP protocol refers to web pages created:


a.) on a web server.
b.) without information from a database.
c.) without knowledge of previous web pages.
d.) before a request from a client.
e.) on a client machine.
Answer: c Level: Moderate
Section: 13-2 Page: 346

42. Client-side state management techniques are appropriate when using:


a.) sensitive information.
b.) critical applications.
c.) an intranet.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Moderate


Section: 13-3 Page: 346

43. Where does the view state store information?


a.) HTML source
b.) Text file
c.) URL
d.) Both a and b.
e.) All of the above.

Answer: a Level: Moderate


Section: 13-3 Page: 347

44. Where does the query string store information?


a.) HTML source
b.) Text file
c.) URL
d.) Both a and b.
e.) All of the above.

Answer: c Level: Moderate


Section: 13-3 Page: 347

45. Where do cookies store information?


a.) HTML source
b.) Text file
c.) URL
d.) Both a and b.
e.) All of the above.

Answer: b Level: Moderate


Section: 13-3 Page: 347

46. Which client-side technique is specific to ASP.NET?


a.) Cookies
b.) Query string
c.) View state
d.) Both a and b.
e.) All of the above.
Answer: c Level: Hard
Section: 13-3 Page: 347

47. Which client-side technique can be disabled by the end-user?


a.) Cookies
b.) Query string
c.) View state
d.) Both a and b.
e.) All of the above.

Answer: a Level: Moderate


Section: 13-3 Page: 347

48. What symbol specifies the beginning of a query string?


a.) @
b.) #
c.) $
d.) %
e.) ?

Answer: e Level: Easy


Section: 13-3 Page: 347

49. What is the syntax for creating and using an application variable?
a.) Application.VariableName = Value
b.) Application.VariableName = (Value)
c.) Application(VariableName) = Value
d.) Application(VariableName) = (Value)
e.) Application(“VariableName”) = Value

Answer: e Level: Moderate


Section: 13-4 Page: 348

50. Which server-side technique is available in ASP.NET?


a.) Application states
b.) Session states
c.) Database support
d.) Both a and b.
e.) All of the above.

Answer: d Level: Easy


Section: 13-4 Page: 349

51. An Application variable is created:


a.) when the application is first placed on a web server.
b.) when the web server is first started.
c.) when the first client requests a URL resource.
d.) every time a client requests a URL resource.
e.) every time a new client interacts with the web application.
Answer: c Level: Moderate
Section: 13-4 Page: 348

52. A Session variable is created:


a.) when the application is first placed on a web server.
b.) when the web server is first started.
c.) when the first client requests a URL resource.
d.) every time a client requests a URL resource.
e.) every time a new client interacts with the web application.

Answer: e Level: Moderate


Section: 13-4 Page: 349

53. If there is no activity from a browser, how long will a session variable last?
a.) 10 minutes
b.) 20 minutes
c.) 60 minutes
d.) 100 minutes
e.) 200 minutes

Answer: b Level: Easy


Section: 13-4 Page: 349

54. Which is not a reason for using a database to store state information?
a.) The capacity to store high volumes of information
b.) The ability to use data mining techniques on the stored information
c.) The ability to use application and session variables
d.) Security from unauthorized use
e.) The power to easily query for specific information

Answer: c Level: Hard


Section: 13-4 Page: 350

Multiple Choice Questions


37. Which control is an example of an object in VB.NET?
a.) Button
b.) Label
c.) Textbox
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 14-1 Page: 390

38. Which of the following is part of an object?


a.) Methods
b.) Properties
c.) Instances
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 14-1 Page: 390

39. Which is true about objects?


a.) Objects are used to create classes.
b.) Objects are analogous to blueprints.
c.) Objects combine actions and data.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Moderate


Section: 14-1 Page: 391

40. Properties are used to represent:


a.) actions.
b.) classes.
c.) data.
d.) events.
e.) instances.

Answer: c Level: Easy


Section: 14-1 Page: 391

41. Methods are used to represent:


a.) actions.
b.) classes.
c.) data.
d.) events.
e.) instances.

Answer: a Level: Easy


Section: 14-1 Page: 391

42. The term instantiation refers to the creation of:


a.) a class from a blueprint.
b.) an object from a class.
c.) a method from an object.
d.) a property from a method.
e.) a blueprint from a property.
Answer: b Level: Moderate
Section: 14-1 Page: 391

43. Anything in VB.NET that has a property or method is:


a.) a class.
b.) a control.
c.) an object.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Moderate


Section: 14-1 Page: 391

44. Which feature is needed to make a programming language object oriented?


a.) Encapsulation
b.) Inheritance
c.) Polymorphism
d.) Both a and b.
e.) All of the above.

Answer: e Level: Easy


Section: 14-2 Page: 391

45. We should think of the practice of object-oriented programming as:


a.) a simple answer to the complex problem of creating software.
b.) an incremental improvement to the problem of creating software.
c.) the way to get rid of a werewolf.
d.) Both a and b.
e.) All of the above.

Answer: b Level: Moderate


Section: 14-2 Page: 391

46. Encapsulation makes it easier to:


a.) reuse and modify existing modules of code.
b.) write and read code by sharing method names.
c.) hide and protect data from external code.
d.) Both a and b.
e.) All of the above.

Answer: c Level: Moderate


Section: 14-2 Page: 392

47. Inheritance makes it easier to:


a.) reuse and modify existing modules of code.
b.) write and read code by sharing method names.
c.) hide and protect data from external code.
d.) Both a and b.
e.) All of the above.
Answer: a Level: Moderate
Section: 14-2 Page: 392

48. Polymorphism makes it easier to:


a.) reuse and modify existing modules of code.
b.) write and read code by sharing method names.
c.) hide and protect data from external code.
d.) Both a and b.
e.) All of the above.

Answer: b Level: Moderate


Section: 14-2 Page: 393

49. The standard prefix to signify a class is:


a.) B.
b.) C.
c.) L.
d.) S.
e.) T.

Answer: e Level: Moderate


Section: 14-2 Page: 392

50. When using encapsulation how should data be shared with external code?
a.) Events
b.) Methods
c.) Properties
d.) Private variables
e.) Public variables

Answer: c Level: Moderate


Section: 14-2 Page: 392

51. Which statement is true?


a.) A base class inherits some of the properties of a derived class.
b.) A base class inherits all of the properties of a derived class.
c.) A derived class inherits some of the properties of a base class.
d.) A derived class inherits all of the properties of a base class.
e.) None of the above.

Answer: d Level: Moderate


Section: 14-2 Page: 392

52. When a base class is changed:


a.) there is no effect on the derived class.
b.) the derived class changes when the key word Overridden is used.
c.) only the methods of the derived class change.
d.) only the properties of the derived class change.
e.) the derived class automatically changes.
Answer: e Level: Easy
Section: 14-2 Page: 392

53. Polymorphism can apply to:


a.) math operators.
b.) method names.
c.) object names.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 14-2 Page: 393

54. With polymorphism:


a.) one method can have multiple names.
b.) one object can have multiple names.
c.) many methods can share the same name.
d.) many objects can share the same name.
e.) None of the above statements are true.

Answer: c Level: Hard


Section: 14-2 Page: 393

55. Which element of a class is optional?


a.) Constructs
b.) Fields
c.) Methods
d.) Properties
e.) All of the above.

Answer: e Level: Moderate


Section: 14-3 Page: 394

56. What is the suggested order for the definition of class elements from first to last?
a.) Constructs, fields, methods, properties
b.) Properties, constructs, fields, methods
c.) Fields, properties, constructs, methods
d.) Constructs, properties, fields, methods
e.) Methods, constructs, properties, fields

Answer: c Level: Hard


Section: 14-3 Page: 394

57. The standard for designing a field is that it be defined as a:


a.) private method.
b.) public method.
c.) private variable.
d.) public variable.
e.) None of the above.
Answer: c Level: Moderate
Section: 14-3 Page: 393

58. What is the syntax for making a property read-only?


a.) Property Read propertyname As datatype
b.) Read Property propertyname As datatype
c.) ReadOnly Property propertyname As datatype
d.) Read-Only Property propertyname As datatype
e.) RO Property propertyname As datatype

Answer: c Level: Moderate


Section: 14-3 Page: 395

59. The Get procedure of a property acts like:


a.) an event.
b.) a function.
c.) a variable.
d.) Both a and b.
e.) All of the above.

Answer: b Level: Hard


Section: 14-3 Page: 395

60. A method in a class is:


a.) a sub procedure.
b.) a function.
c.) an event.
d.) Both a and b.
e.) All of the above.

Answer: d Level: Moderate


Section: 14-3 Page: 396

61. How many constructors can a class have?


a.) 0
b.) 1
c.) 2
d.) 3
e.) All of the above.

Answer: e Level: Easy


Section: 14-3 Page: 397

62. A constructor is a special type of:


a.) class.
b.) field.
c.) method.
d.) property.
e.) variable.
Answer: c Level: Easy
Section: 14-3 Page: 397

63. Which is true for constructors in a class?


a.) All constructors must have the same number of parameters.
b.) All constructors must be the same parameter data type.
c.) Some constructors can have the same list of parameters.
d.) Only two constructors in a class can have the same list of parameters.
e.) No two constructors in a class can have the same list of parameters.

Answer: e Level: Moderate


Section: 14-3 Page: 397

64. Which statement will call a constructor of a base class?


a.) Base.New( )
b.) BaseConstructor.New ( )
c.) CallBase.New( )
d.) Constructor.New ( )
e.) MyBase.New( )

Answer: e Level: Moderate


Section: 14-3 Page: 397
Visual Basic Programming MCQs
1. Visual Basic is a tool that allows you to develop application in…………
a. Real time
b. Graphical User Interface
c. Character User Interface
d. None of These
2. Form_Mouse Down ( ) procedure is executed when any mouse button is clicked in a free area of
the ______.
a. window
b. form
c. screen
d. None of the above.
3. _____ method removes a dialog box from view.
a. Display
b. Disable
c. Hide
d. Enabled
4. _______ is used for finding out about objects, properties and methods.
a. Object browser
b. Form layout window
c. Code editor window
d. None of the above
5. _______ cannot be declared in a form or class module
a. Public constants
b. Private constants
c. Static constants
d. None of these
6. _______ function is used to return a copy of a string without leading spaces.
a. Ltrim
b. Rtrim
c. Trim
d. All of the above
7. _______ is a method which moves the focus to the specified control or form
a. Setfocus
b. Gotfocus
c. Lostfocus
d. None of these
8. The default property for a text box control is _____
a. Text
b. Password char
c. Multiline
d. Enable
9. The ______ is a tool used for both the Input and output purpose.
a. command button
b. text box
c. label
d. combo box
10. In visual basic the declaration of variables is done by _____ key word.
a. int
b. dim
c. static
d. declare

For more questions please visit www.gkseries.com


Visual Basic Multiple Choice Questions and Answers :-
1. The Visual Basic Code Editor will automatically detect certain types of errors as you are
entering code.
A. True
B. False
Ans: A

2. Keywords are also referred to as reserved words.


A. True
B. False
Ans: A

3. The divide-and-conquer-method of problem solving breaks a problem into large, general


pieces first, then refines each piece until the problem is manageable.
A. True
B. False
Ans: A

VISUAL BASIC Multiple Choice Questions and Answers

4. Visual Basic responds to events using which of the following?


A. a code procedure
B. an event procedure
C. a form procedure
D. a property
Ans: B

5. When the user clicks a button, _________ is triggered.


A. an event
B. a method
C. a setting
D. a property
Ans: A

6. What property of controls tells the order they receive the focus when the tab key is
pressed during run time?
A. Focus order
B. Focus number
C. Tab index
D. Control order
Ans: C

7. Sizing Handles make it very easy to resize virtually any control when developing
applications with Visual Basic. When working in the Form Designer, how are these sizing
handles displayed?
A. A rectangle with 4 arrows, one in each corner, around your control.
B. A 3-D outline around your control.
C. A rectangle with small squares around your control.
D. None of the above.
Ans: C

8. The Properties window plays an important role in the development of Visual Basic
applications. It is mainly used
A.to change how objects look and feel.
B. when opening programs stored on a hard drive.
C. to allow the developer to graphically design program components.
D. to set program related options like Program Name, Program Location, etc.
Ans: A

9. When creating a new application in Visual Basic, you are asked to supply a name for the
program. If you do not specify a name, a default name is XXXXX XXXXX is this default
name?
A. Wapplication followed by a number.
B. Application followed by a number.
C. WindowsApplication.
D. WindowsApplication followed by a number.
Ans: C,B

10. Which of the properties in a control’s list of properties is used to give the control a
meaningful name?
A. Text
B. ContextMenu
C. ControlName
D. Name
Ans: D

11. Pseudocode is
A. data that have been encoded for security.
B. the incorrect results of a computer program.
C. a program that doesn’t work.
D. the obscure language computer personnel use when speaking.
E. a description of an algorithm similar to a computer language.
Ans: E

12. An algorithm is defined as:


A. a mathematical formula that solves a problem.
B. a tempo for classical music played in a coda.
C. a logical sequence of steps that solve a problem.
D. a tool that designs computer programs and draws the user interface.
Ans: C
13. A variable declared inside an event procedure is said to have local scope
A. True
B. False
Ans: A

14. A variable declared outside of an event procedure is said to have class-level scope.
A. True
B. False
Ans: A

15. Option Explicit requires you to declare every variable before its use.
A. True
B. False
Ans: A

16. The value returned by InputBox is a string.


A. True
B. False
Ans: A

17. What is the correct statement when declaring and assigning the value of 100 to an
Integer variable called numPeople
A. Dim numPeople =
B. Dim numPeople = Int(100)
C. numPeople = 100
D. Dim numPeople As Integer = 100
Ans: D

18. Which of the following arithmetic operations has the highest level of precedence?
A. + –
B. * /
C. ^ exponentiation
D. ( )
Ans: C

19. What value will be assigned to the numeric variable x when the following statement is
executed? x = 2 + 3 * 4
A. 20
B. 14
C. 92
D. 234
Ans: B

20. Which of the following is a valid name for a variable?


A. Two_One
B. 2One
C. Two One
D. Two.One
Ans: A

21. Keywords in Visual Basic are words that


A. should be used when naming variables.
B. are used to name controls, such as TextBox1, Command2, etc.
C. have special meaning and should not be used when naming variables.
D. are used as prefixes for control names (such as txt, btn, lbl, and lst).
Ans: C

22. To continue a long statement on another line, use:


A. an underscore character.
B. an ampersand character.
C. Ctrl + Enter.
D. a space followed by an underscore character.
Ans: A

23. What is the proper syntax when using a message dialog box?
A. MessageBox.Show(“Hi there”, “Hi”)
B. MessageBox.Show(Hi there, Hi)
C. MessageBox.Show “Hi There”, “Hi”
D. MessageBox.Show Hi There, Hi
Ans: A

24. What will be the output of the following statement? txtBox.Text =


FormatCurrency(1234.567)
A. $1234.567
B. 1,234.57
C. $1234.57
D. $1,234.57
Ans: D

25. The following lines of code are correct. If age >= 13 And < 20 Then txtOutput.Text =
“You are a teenager.” End If
A. True
B. False
Ans: B

26. Given that x = 7, y = 2, and z = 4, the following If block will display “TRUE”. If (x > y)
Or (y > z) Then txtBox.Text = “TRUE” End If
A. True
B. False
Ans: A

27. Asc(“A”) is 65. What is Asc(“C”)?


A. 66
B. 67
C. 68
D. “C”
Ans: B

28. Asc(“A”) is 65. What is displayed by txtBox.Text = Chr(65) & “BC”?


A. ABC
B. A BC
C. 656667
D. Not enough information is available.
Ans: A

29. Which of the following expressions has as its value the words “Hello World?
surrounded by quotation marks?
A. “Hello World”
B. Chr(34) & “Hello World”
C. Chr(34) & Hello World & Chr(34)
D. Chr(34) & “Hello World” & Chr(34)
Ans: A

30. Which of the following is true?


A. “Cat” = “cat”
B. “Cat” < “cat”
C. “Cat” > “cat”
D. Relational operators are only valid for numeric values.
Ans: B

31. Which of the following is a valid Visual Basic conditional statement?


A. 2 < n < 5
B. 2 < n Or < 5
C. 2 < n Or 5
D. (2 < n) Or (n < 5)
Ans: D

32. The three main logical operators are ________, _________, and ________.
A. And, Or, Not
B. And, Not, If
C. Or, Not, If
D. False, And, True
Ans: A

33. Which value for x would make the following condition true: x >= 5
A. x is equal to 7
B. x is equal to 5
C. x is equal to 5.001
D. all of the above
Ans: D

34. Which value for x would make the following condition true: Not (x >= 5)
A. x is equal to 7
B. x is equal to 4
C. x is equal to 5.001
D. x is equal to 5.001
Ans: B

35. Which value for x would make the following condition true: (x >= 5) And (x <= 6)
A. x is equal to 7
B. x is equal to 5
C. x is equal to 5.001
Ans: B,C

36. Constructs in which an If block is contained inside another If block are called:
A. multi-If blocks
B. nested If blocks
C. sequential If blocks
D. none of the above
Ans: B

37. One may use an If block within a Select Case block.


A. True
B. False
Ans: A

38. One may use a Select Case block within an If block.


A. True
B. False
Ans: A

39. Select Case choices are determined by the value of an expression called a selector.
A. True
B. False
Ans: A
40. Items in the value list must evaluate to a literal of the same type as the selector
A. True
B. False
Ans: A

41. A single Case statement can contain multiple values.


A. True
B. False
Ans: A

42. You can specify a range of values in a Case clause by using the To keyword.
A. True
B. False
Ans: A

43. A variable declared inside a Select Case block cannot be referred to by code outside of
the block.
A. True
B. False
Ans: A

44. Suppose that the selector in a Select Case block is the string variable myVar. Which of
the following is NOT a valid Case clause?
A. Case “Adams”
B. Case “739”
C. Case (myVar.Substring(0, 1)
D. Case myVar.Length
Ans: D

45. Different items appearing in the same value list of a Select Case block must be
separated by a ____________.
A. semi colon
B. comma
C. colon
D. pair of quotation marks
Ans: B

46. Which Case clause will be true whenever the value of the selector in a Select Case block
is between 1 and 5 or is 8?
A. Case 1 To 8
B. Case 1 To 5, 8
C. Case 1 To 8, 5
D. Case 1 To 5; 8
Ans: B
47. Which Case clause will be true whenever the value of the selector in a Select Case block
is greater than or equal to 7?
A. Case Is >7
B. Case Is = 8
C. Case Is >= 7
D. Case Is <= 8
Ans: C

48. What type of items are valid for use in the value list of a Case clause?
A. literals
B. variables
C. expressions
D. all of the above
Ans: D

49. What happens to a variable declared locally inside a Sub procedure after the procedure
terminates?
A. It maintains its value even after the End Sub statement executes.
B. It ceases to exist after the End Sub statement executes.
C.It loses its value temporarily after the End Sub statement executes, but regains that value upon
re-entry to the Sub procedure.
D. It is reset to its default value.
Ans: B

50. Suppose a variable is passed by reference to a parameter of a Sub procedure, and the
parameter has its value changed inside the Sub procedure. What will the value of the
variable be after the Sub procedure has executed?
A. It will have the newly modified value from inside the Sub procedure.
B. Its value can?t be determined without more information.
C. It will retain the value it had before the call to the Sub procedure
D. None of the above.
Ans: A

51. Suppose a variable is passed by value to a parameter of a Sub procedure, and the
parameter has its value changed inside the Sub procedure. What will the value of the
variable be after the Sub procedure has executed?
A. It will have the newly modified value from inside the Sub procedure.
B. Its value can?t be determined without more information
C. It will retain the value it had before the call to the Sub procedure
D. None of the above.
Ans: C

52. The declaration statement for a class-level variable should be placed __________.
A. inside an event procedure
B. inside a general procedure
C. anywhere in the program region, except inside a procedure
D. above the statement Public Class frmName
Ans: C

53. Variables declared inside a procedure are said to have ________________.


A. local scope
B. procedure-level scope
C. class-level scope
D. none of the above
Ans: A

54. What will be the output of the following program when the button is clicked?
Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim number As Double = 3
DoubleAndSquare(number)
txtBox.Text = CStr(number)
End Sub
Sub DoubleAndSquare(ByRef myVar As Double)
myVar = myVar + myVar
myVar = myVar * myVar
A. 3
B. 36
C. 6
D. 0
Ans: B

55. Suppose the variable myName is declared in a Dim statement in two different Sub
procedures. Which statement is true?
A. The program will malfunction when it is executed.
B. When the value of myName is changed in one Sub procedure, it will also be changed in the
other Sub procedure.
C. Visual Basic’s smart editor will alert you that this is an error before the program is executed.
D. The two variables will be local to their respective Sub procedures.
Ans: D

56. Which of the following statements is guaranteed to pass the variable numVar by value
to the Sub procedure Tally?
A. Tally(numVar)
B. Tally(ByVal numVar)
C. Tally((numVar))
D. Tally(ByVal numVar As Double)
Ans: D
57. The ______________ of a Sub procedure are vehicles for passing numbers and strings
to the Sub procedure.
A. Call Statements
B. arguments
C. parameters
D. variables declared inside
Ans: C

58. Which of the following is NOT a reason for using procedures?


A. They break a complex problem down into smaller pieces.
B. They make a program run faster.
C. They can be reused easily.
D. They make it possible for a team of people to work together on a single program.
Ans: B

59. Which one of the following is true about arguments and parameters?
A. Arguments appear in Call statements; parameters appear in Sub statements.
B. Parameters appear in Call statements; arguments appear in Sub statements.
C. They are synonymous terms.
D. They are completely unrelated in a program.
Ans: A

60.Each individual variable in the list student(0), student(1), student(2) is known as a(n)
A. subscript
B. dimension
C. element
D. type
Ans: C

62. The statement Const TAX_RATE As Doubleface=Calibri size=2> is not valid.


A. True
B. False
Ans: A

63. Function names should be suggestive of the role performed. The names also must
conform to the rules for naming variables.
A. True
B. False
Ans: A

64. The input to a user-defined function can consist of one or more values.
A. True
B. False
Ans: A
65. Both the input and output of a Function procedure can consist of several values.
A. True
B. False
Ans: B

66. Suppose you want to write a procedure that takes three numbers, num1, num2, and
num3; and returns their sum, product, and average. It is best to use a Function procedure
for this task.
A. True
B. False
Ans: B

67. Although a function can return a value, it cannot directly display information in a text
box.
A. True
B. False
Ans: B

68. Function procedures can invoke other Function procedures.


A. True
B. False
Ans: A

69. A Function may return up to two values.


A. True
B. False
Ans: B

70. The input to a user-defined function can consist of:


A. a single value
B. one or more values
C. no values
D. All of the above
Ans: D

71. Variables appearing in the header of a Function procedure are called ____________.
A. values of the function
B. parameters
C. coordinates
D. arguments
Ans: B

72. The arguments appearing in a Call statement must match the parameters in the
appropriate Sub or Function header in all but one of the following ways. Which one?
A. Number of arguments
B. Names of arguments
C. Data type of arguments
D. Order of arguments
Ans: B

73. What will be the output of the following program when the button is clicked?
Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim word, result As String
word = “Benjamin”
result = Rotate(word)
result = Rotate(result & word)
result = Rotate(result)
txtBox.Text = result
End Sub
Function Rotate(ByVal var As String) As String
Dim varlength As Integer
varlength = var.Length
Return var.Substring(1) & var.Substring(0, 1)
End Function
A. jaminBBenjaminen
B. BenjaminBenjamin
C. njaminBe
D. None of the above
Ans: A

74. What is displayed when the button is clicked?


Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim a, b as String
Dim x as Integer
a = “How now brown cow.”
b = “brown”
x = FindIt(a, b)
txtBox.Text = CStr(x)
End Sub
Function FindIt(ByVal z1 as String, ByVal z2 as String) As Integer
Dim x as Integer
x = z1.IndexOf(z2)
End Function
“How now”
A. 8
B. 0
C. An error
D. None of the above
Ans: D
75. A Do While loop checks the While condition before executing the statements in the loop.
A. True
B. False
Ans: A

76. A Do?Loop Until block is always executed at least once


A. True
B. False
Ans: A

77. A counter variable is normally incremented or decremented by 1.


A. True
B. False
Ans: A

78. The value of the control variable should not be altered within the body of a For?Next
loop.
A. True
B. False
Ans: B

79. The body of a For…Next loop in Visual Basic will always be executed once no matter
what the initial and terminating values are.
A. True
B. False
Ans: B

80. The body of a For…Next loop in Visual Basic will always be executed once no matter
what the initial and terminating values are. duplicate question?
A. True
B. False
Ans: B

00

You might also like