Вы находитесь на странице: 1из 43

CHAPTER 1

1
CORREC
T

Microsoft Windows uses a GUI environment. GUI (pronounced "gooey") stands for
_______.
Geographical User Interchange
A)
Graphical User Interface
B)
Geometrical Upper Intelligence
C)
Grammatical User Incorporation
D)

2
CORREC
T

Visual Basic is a(n) _______.

Procedural programming language


A)
Object-oriented programming language
B)
Hyperlink programming language
C)
Sequential programming language
D)

3
CORREC
T

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

Programmer preference
A)
Projects, solutions, and procedures
B)

Classes, actions, and disciplines

C)
Properties, methods, and events
D)

4
CORREC
T

When you plan a Visual Basic program, you follow a three-step process that should
end with _______.
Setting the properties
A)
Writing the Basic code
B)
Coding all of the remark statements
C)
Defining the user interface
D)

5
CORREC
T

After the steps for planning a Visual Basic project are competed, you can begin
actually constructing a program by _______.
Setting the properties
A)
Creating the interface
B)
Writing the code
C)
Executing the next step based on the programmer's preference
D)

6
CORREC
T

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

Set the properties, create the interface, write the code


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

B)
Create the interface, write the code, set the properties
C)
Write the code, set the properties, create the interface
D)

7
CORREC
T

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
The project file
A)
The resource file
B)
The solution file
C)
The .vb file
D)

8
CORREC
T

Each Visual Basic project contains a text file that defines all resources used by the
form. This file has a _______ extension
Resx
A)
Designer.vb
B)
sln
C)
vb
D)

9
CORREC
T

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

A)
The Solution window
B)
The Properties window
C)
The Form Designer window
D)

10
CORREC
T

Which window do you open if you want to see all of the objects that you can add to
a form?
The Toolbox
A)
The Solution window
B)
The Properties window
C)
The Form Designer
D)

1
CORREC
T

With Visual Basic, you can write computer programs that run in the Microsoft
Windows environment
True
A)
False
B)

2
CORREC

Visual Basic is an object-oriented programming language

T
True
A)
False
B)

3
CORREC
T

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

True
A)
False
B)

4
CORREC
T

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


planning
True
A)
False
B)

5
CORREC
T

When creating a project in Visual Basic, you should always begin by writing the
Basic code
True
A)
False
B)

6
CORREC
T

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

A)
False
B)

7
CORREC
T

The .resx file is a text file that defines all resources used by the form including any
graphics that are displayed on the form
True
A)
False
B)

8
CORREC
T

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

True
A)
False
B)

9
CORREC
T

The Solution Explorer window is used to design a form that makes up your user
interface
True
A)
False
B)

10
CORREC
T

You are in run time when you design the user interface

True
A)

False

B)

CHAPTER TWO
1 CORRECT
Which of the following objects is a container?
MaskedTextBox
A)
GroupBox
B)
RadioButton
C)
RichTextBox
D)

2 CORRECT
The property used to display information in a TextBox is _______.
Caption
A)
Name
B)
Text
C)
Appearance
D)

3 CORRECT
In NameTextBox.Text, _______.
The property is NameTextBox
A)

The property is Text


B)
The object is Name
C)
The object is Text
D)

4
INCORRECT

If you want to display text that cannot be modified by the user, use the
_______.
TextBox control
A)
Label control
B)
Caption control
C)
MaskedTextBox control
D)

5 CORRECT
If you want to display text that can be modified by the user, use the _______.
TextBox control
A)
Label control
B)
Caption control
C)
MaskedTextBox control
D)

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

Textbox
A)
Label
B)
Button
C)
CheckBox
D)

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
AlignLeft
A)
Text
B)
Left
C)
TextAlign
D)

8 CORRECT
In code, you can make the text in a text box display left-aligned by using
________.
ObjectName.TextAlign = HorizontalAlignment.Left
A)
ObjectName.Alignment = Left
B)
ObectName.Left = True
C)
ObjectName.HorizontalAlignment = Left
D)

9 CORRECT
Which of the following is the best choice when the user needs to input her social
security number?
RichTextBox
A)
TextBox
B)
MaskedTextBox
C)
GroupBox
D)

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 _______.
RichTextBox
A)
TextBox
B)
MaskedTextBox
C)
GroupBox
D)

1 CORRECT
Labels are used primarily for user input
True
A)
False
B)

2
INCORRECT

TextBoxes can only display a single line of text, but RichTextBoxes can display
text on multiple lines
True
A)
False
B)

3 CORRECT
A form can contain multiple group boxes
True
A)
False
B)

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
True
A)
False
B)

5
INCORRECT

Your project requires the user to choose his or her gender. You should display
the choices, Male and Female, using check boxes
True
A)
False
B)

6 CORRECT

The default setting for the Checked property of a check box is True
True
A)
False
B)

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

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

9 CORRECT
The user can select multiple radio buttons in the same group
True
A)
False
B)

10
CORRECT

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


True
A)
False
B)

CHAPTER THREE
1
CORREC
T

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
CORREC
T

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 hold
C)
Are not needed for constants
D)

3
CORREC
T

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

Integer
A)
Real
B)
Decimal
C)
String
D)

4
CORREC
T

The data type that is used for decimal fractions is _______.

Decimal
A)
Short
B)
Integer
C)
Fraction
D)

5
CORREC
T

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
CORREC
T

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
CORREC
T

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
CORREC
T

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
CORREC
T

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
CORREC
T

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 type
B)
Identifiers for constants should begin with a prefix of Const
C)
Identifiers for constants should use an underscore between words
D)

1 CORRECT
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
INCORRECT

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 CORRECT
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
CORRECT

Although it is best to always declare the data type on a Dim statement, the data
type is optional
True
A)
False
B)

CHAPTER 4

1 CORRECT
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
INCORRECT

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
INCORRECT

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)

1
INCORRECT

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 CORRECT
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
INCORRECT

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 CORRECT
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)

CHAPTER 5

1 CORRECT
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)

C)

In a menu, submenus will be indicated by a filled triangle to the right of the


command

Each item in a menu can have keyboard access


D)

2 CORRECT
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)

C)

You can add a separator between menu items by using the Line control from
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)

B)

C)

Do not use the same access key on a main menu name as you use on a
form control
When the program is running, use the Alt key with the letter in the menu
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 CORRECT
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 CORRECT
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 CORRECT
Common Dialog Boxes _______.

A)

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

B)
Can only be used on forms with menus
C)

D)

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

8 CORRECT
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 CORRECT
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)

1
CORREC
T

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
CORREC
T

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
CORREC
T

By default, all new menu items have their Enabled property set to True

True
A)

False
B)

4
CORREC
T

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

True
A)
False
B)

5
CORREC
T

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
CORREC
T

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
CORREC
T

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
CORREC
T

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

9
CORREC
T

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

True
A)
False
B)

10
CORREC
T

Functions perform an action and return a value

True
A)
False
B)

CHAPTER 6

1 CORRECT
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 CORRECT
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
INCORRECT

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 CORRECT
You can remove a form from a project by _______.

A)

B)

C)

Selecting the form's name in the Solution Explorer window and clicking the
delete key
Writing code in a button on the form that uses the form name and the Close
method
Right-clicking on the form's name in the Solution Explorer window and
choosing Delete
Both answers A and C would remove a form from a project

D)

7 CORRECT
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 CORRECT
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
CORRECT

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)

1 CORRECT
Multiple forms are allowed in Visual Basic projects
True
A)
False
B)

2
INCORRECT

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
INCORRECT

Forms can be used in multiple projects


True
A)
False
B)

10
INCORRECT

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)

CHAPTER 7
1 CORRECT
Use the _______ control from the toolbox to create list boxes on a form

List
A)
ListBox
B)
ComboBox
C)
SimpleList
D)

2 CORRECT
A _______ control contains a text box as part of the control
Frame
A)
ListBox
B)
ComboBox
C)
DropDownList
D)

3
INCORRECT

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


Simple
A)
DropDown
B)
DropDownList
C)
SimpleList
D)

4
INCORRECT

List boxes and combo boxes _______.

Are created with the same tool from the toolbox


A)
Have a Text property during design time
B)
Hold a list of values
C)
Always have scroll bars
D)

5 CORRECT
Items can be added to a list during design time using the _________ collection.
AddLists
A)
Items
B)
ItemsAdd
C)
AddItems
D)

6 CORRECT
Values for the items in a list _______.
Can be entered in the Items collection in the Properties window
A)
Can be entered in the Values collection in the Properties window
B)
Can be entered in the AddItem collection in the Properties window
C)
Must be entered in alphabetical order
D)

7
INCORRECT

The data that appears in a combo box when it is first displayed can be added to

the combo box _______.


Using the Form_Load procedure and the combo box Items.Add method
A)
During design time in the Items Collection of the combo box
B)
Using the ComboBox.Add () method
C)
Answers A and B are correct.
D)

8 CORRECT
Items can be added to a list during run time using the _________ method
AddLists
A)
Lists
B)
ItemsAdd
C)
Items.Add
D)

9
INCORRECT

Items in a list can be placed in alphabetical order by _______.


Setting the Sorted property to true
A)

B)

Selecting the item in the list and then using the arrow keys to move the
item up or down the list
Setting the Alphabetize property to true

C)
Setting the Index property to 1
D)

10
CORRECT

Which of the following instructions will add the word, monkey, to a list box
named AnimalsListBox?
AnimalsListBox.Insert(monkey)
A)
AnimalsListBox.Insert ("monkey")
B)
AnimalsListBox.Items.Add(monkey)
C)
AnimalsListBox.Items.Add("monkey")
D)

1
INCORRECT

To add scroll bars to list boxes and combo boxes you must set the
ScrollAlwaysVisible property to True.
True
A)
False
B)

2
INCORRECT

List boxes have a Text property, but it can only be accessed at run time
True
A)
False
B)

3
INCORRECT

List boxes and combo boxes have a Text property that can be accessed at design
time
True
A)
False
B)

4 CORRECT
Items are added to a list box during design-time with the ListIndex property.
True
A)
False
B)

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

6 CORRECT
List boxes and combo boxes can only hold numeric values.
True
A)
False
B)

7 CORRECT
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.

True
A)
False
B)

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

9
INCORRECT

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


True
A)
False
B)

10
CORRECT

If a list contains 15 items, the Count property will be 15 and the highest
SelectedIndex property will be 16.
True
A)
False
B)

Вам также может понравиться