CPT187Test2 Flashcards

1
Q

_______ is an arithmetic operation.

A

division, addition, multiplication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The Decimal data type can represent __________

A

dollar amounts, very precise decimal numbers, large numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A _____ can be represented by using the Char data type.

A

letter, punctuation symbol, symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The prefix ______ should be used for naming a TextBox object.

A

txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The event handler of a button designated as the Cancel button will be processed when the user presses the ______ key on the keyboard.

A

ESC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Where is a variable stored and what is it?

A

A variable is a named location in RAM where data is stored.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What data types have one byte?

A

byte

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What data types have 2 bytes?

A

char, short, Boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What data types have 4 bytes?

A

integer, object and single

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what data types have 8 bytes?

A

Double, Date, Long

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What data type occupy 16 bytes?

A

Decimal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

abbr for String

A

str

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

abbr for Integer

A

int

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

abbr for Decimal

A

dec

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

abbr for Double

A

dbl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

abbr for Char

A

chr

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

abbr for Boolean

A

bln

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

abbr for Byte

A

byt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

abbr for Date

A

dtm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

abbr for Long

A

lng

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

abbr for Short

A

shr

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

abbr for Single

A

sng

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the prefixes for each object?

A

TextBox object and MaskedTextBox object, txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the difference between the accept, cancel, and focus and what do they do?

A

When the focus is on a TextBox object, the insertion point is located in the text box. The Focus procedure does this automatically without requiring the user to click in the box. The statement looks like this: txtNumberOfDownloads.Focus()
You can assign a button in the user interface to be an Accept button, which means the program will carry out the event handler processing associated with the button if the user clicks the button or presses the ENTER key.
You can also do the same with the Cancel button.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What does the esc key do when using the Cancel button?

A

When the user presses the ESC key, the event handler processing for the button identified as the Cancel button will be executed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What keyword is used when defining a variable?

A

Dim

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

When defining a variable, what goes at the end of the statement?

A

As and the declaration for the variable type being defined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Know the full statement setup.

A

Dim strNumberOfSongs As String

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is the assignment operator?

A

=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What does the blue squiggly line mean? green?

A

compile error, when a variable is declared it will be underlined with a green squiggly line until it is referenced in a statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is the scope of the variable?

A

specifies where within the program the variable can be referenced in a Visual Basic statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is the lifetime of the variable?

A

They are only “alive” from the time the procedure begins executing until the procedure ends. If the procedure executes again the previous value is no longer present.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What does “Option Strict On” do?

A

This statement disallows any default data type conversions in which data loss would occur and any conversion between numeric data types and strings. Therefore, you must write explicit conversion statements in order to convert from one data type to another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Know the symbols for arithmetic operators

A

+ addition
- subtraction
* multiplication
/ division
^ exponentiation
\ integer division, will divide the number and leave off the remainder
Mod gives the remainder only after division
order of ops is Please Excuse My Dear Integer Mod Aunt Sally

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is concatenation and what is the operator for using it?

A

The process of joining two different values into a single string. The ampersand (&).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

When do Format Exception, Overflow Exception and Divide By Zero Exception occur?

A

A Format Exception occurs when the user enters data that a statement within the program cannot process properly.
An Overflow Exception occurs when the user enters a value greater than the maximum value that can be processed by the statement.
A Divide By Zero Exception occurs when the program contains a division operation and the divisor is equal to zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

allows the user to enter data into a program

A

TextBox object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

allows the text in a TextBox object to be aligned left, right or center

A

TextAlign property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

allows the user to enter multiple lines in the text box

A

MultiLine textbox

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

allows you to specify the data format for the value typed into the text box

A

MaskedTextBox

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

a procedure that performs its task but does not return a value.

A

Sub procedure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

procedure that returns a value

A

function/Function procedure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

to display a numeric in a label or text box, the numeric data must be converted to a String data type. This is what the ToString function does. General format is: decimalvariable.ToString()

A

ToString function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

clears any data currently placed in the Text property of a TextBox object. The general format is: txtTextboxName.Clear()

A

Clear procedure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

When evaluating a condition it evaluates to

A

T or F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

If Then statement can be used to compare arithmetic statement to

A

strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

And or Not, ____ has a higher precedence

A

Not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

difference between radio button and checkbox

A

radio you can only choose one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

What does the Checked property do?

A

sets to True or False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

Features of a Panel object and what it performs

A

performs in the same manner as the GroupBox object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

What are container objects used for?

A

have the purpose of grouping RadioButtons and other objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

Which container is used most often?

A

GroupBox

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

What are not available in Panel that are available in Groupbox?

A

caption, scroll bars, and labeled border

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

What objects are considered container objects?

A

GroupBox, Panel, FlowLayoutPanel, SplitContainer, TabControl, TableLayoutPanel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

What options are available in message boxes? What types do what?

A

Message Box Statement, Message Box Statement with Caption, Message Box Statement with Caption and Button, Message Box Statement with Button and Icon, MsgBox(“Message”,Button Entry Value + Icon Picture Value,”Caption”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

What are the default?

A

MsgBox.OKOnly or 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

What is a decision structure used for?

A

to deal with the different conditions that occur based on the values entered into an application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

A conditional statement is

A

results in either being true or false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

What is the symbol for not equal to?

A

<>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

What does every single If statement have to end with?

A

End If

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

When to use If Then statement

A

When one condition is tested as True or False. If False the the statement is skipped and moves on to the next line of code after the End If

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

If Then Else statement?

A

executes a set of instructions if the statement is true. If False, the instructions under the Else is executed.

63
Q

compound conditions are

A

more than one condition is included in an If Then Else statement.

64
Q

how to create compound conditions

A

you must use a logical operator

65
Q

When and how the And, Or, Not, Xor, AndAlso, OrElse, are used.

A

And - allows you to combine 2 or more conditions into a compound condition that can be tested with an If statement. If any of the conditions stated in the compound condition is false, the compound condition is considered false and the statements following the Else portion of the If statement will be executed.
Or - One condition in the If statement must be true
Not - negates a condition
Xor - When one condition in the compound condition is true, but not both, the compound condition is true
AndAlso - As soon as a condition is found to be false, no further conditions are tested and the compound condition is true
OrElse - As soon as a condition is found to be true, no further conditions are tested and the compound condition is true

66
Q

Select Case structures- How to end, what statement?

A

End Select

67
Q

What a Case Else statement is and includes

A

optional entry that includes all conditions not specifically tested for in the other Case statements. Good programming practice dictates that the Case Else statement should be used so that all cases are accounted for and the program performs a specific action regardless of the value found in the test expression

68
Q

keyword Is, when to use

A

when using relational operators in a Select Case statement

69
Q

how many pieces of code snippets are contained in the code library?

A

500

70
Q

What the function IsNumeric is used for

A

can check the input value to determine if the value can be converted into a numeric value such as an Integer or Decimal data type

71
Q

What does it return and what type of value?

A

True or False Boolean value

72
Q

What the Show procedure in a MessageBox is used for

A

displays a message box window

73
Q

Are unicode numbers less than letters?

A

yes

74
Q

What is the order of letters and numbers in unicode?

A

numbers are less than uppercase letters which are less than lowercase letters

75
Q

What logical And, Or , Not returns

A

And - If any conditions in the statement are false, the statement is false
Or - the compound condition is true if any tested condition is true
Not - is true if the opposite of what the statement says is true

76
Q

GIGO

A

garbage in, garbage out

77
Q

When defining a variable to be used to hold textual information containing multiple characters, the declaration statement should have ______ at the end of the statement.

A

As String

78
Q

A ____________ beneath a variable name in a declaration statement indicates that the variable has not been used in the program.

A

green squiggly underline

79
Q

A(n) __________ data type must be used in arithmetic operations.

A

numeric

80
Q

The memory allocation for the Char data type is __________ bytes.

A

2

81
Q

A(n) _______ variable should be used for values that will consist of a single character only.

A

Char

82
Q

A prefix of _______ is used to denote a variable defined as an Integer data type.

A

int

83
Q

A prefix of ______ is used to denote a variable defined as a Char data type.

A

chr

84
Q

The dtm prefix is used to denote a(n)______ data type.

A

Date

85
Q

The character D is the literal-type character for the __________ data type

A

Decimal

86
Q

The ______ of a variable indicates how long the variable remains active.

A

lifetime

87
Q

When using ________ division (), any remainder amount is dropped or truncated.

A

integer

88
Q

Used with the ToString function, the ____ format specifier will display the value 8967.43561 as 8,967.44.

A

Number

89
Q

Used with the ToString function, the _________ format specifier will display the value 8967.43561 as 8967.43561.

A

General

90
Q

The process of joining two string values together is called ______ .

A

concatenation

91
Q

A(n) ______ Exception occurs when the user enters a value larger than the maximum value that can be processed by the statement.

A

Overflow

92
Q

A(n) __________ object allows users to enter data into a program.

A

TextBox

93
Q

the ________ property of a TextBox object controls the alignment of the text content.

A

TextAlign

94
Q

The event handler of a button designed as the Accept button will be processed when the user presses the ________ key on the keyboard.

A

ENTER

95
Q

A(n) _______ is a named location in RAM that can store a value that may change during program execution.

A

variable

96
Q

A(n) _______ procedure does not return a value.

A

sub

97
Q

A(n) __________ function is a procedure that returns a value when it is called.

A

function

98
Q

The * operator is the ____________ arithmetic operator.

A

multiplication

99
Q

The ______ procedure clears any data currently placed in the Text property of a TextBox object.

A

Clear

100
Q

When a condition is tested in a Visual Basic program, this is a possible outcome:

A

the condition is true

the condition is false

101
Q

When using multiple _____ operators in an If statement, the order of precedence of the operators should be established through the use of parentheses.

A

relational, logical

102
Q

After the Not operator, the _______ logical operator has the next precedence.

A

And, AndAlso

103
Q

Which of the following is a feature of the Panel object?

A

none of the above

104
Q

The Panel object performs in the same manner as the ______ object.

A

GroupBox

105
Q

The ___________ object provides several options not available with the Panel object.

A

GroupBox

106
Q

The Panel, GroupBox, and TabControl objects are examples of __________ objects.

A

container

107
Q

What is the value of the MsgBoxStyle.OKOnly?

A

0

108
Q

A statement that tests a value is called a _______ statement

A

conditional

109
Q

Use the ________ statement to execute one set of instructions if the condition is true, and another set of instructions if the condition is false.

A

If…Then…Else

110
Q

The __________ of a variable means where a variable can be referenced within a program.

A

scope

111
Q

To use multiple conditions in a single If…Then…Else statement, ______ conditions are required.

A

compound

112
Q

An expression using the logical operator ______ will evaluate to true only when both of the conditions are true.

A

And

113
Q

An expression using the logical operator ______ will evaluate to true when either of the compound conditions is true.

A

Or

114
Q

The logical operator _____ has the highest priority and is evaluated first.

A

Not

115
Q

To end a Select Case structure, a(n) _____ statement is used.

A

End Select

116
Q

Which of the following CANNOT be contained in a code snippet?

A

an entire program

117
Q

The ______ function is used to determine if an input value can be converted into a numeric value.

A

IsNumeric

118
Q

If data analyzed by the IsNumeric function cannot be converted to a numeric data type, the function will return a value of ______.

A

False

119
Q

The default setting for the MessageBoxButtons argument of a message box will display only a(n) ______ button in the message box.

A

OK

120
Q

__________ is the MsgBoxButtons argument that displays the Yes and No buttons.

A

MsgBoxStyle.YesNo

121
Q

If the condition tested in an If statement evaluates to _________ , the statement between the If and the End If keywords will be executed.

A

true

122
Q

To test a second condition only after the result of the first condition is known, _________ If statements can be used.

A

nested

123
Q

The logical operator ______ will return a value of true only if all conditions in a compound condition evaluate to true.

A

And

124
Q

The logical operator _______ will return a value of true if at least one condition in a compound condition evaluates to true.

A

Or

125
Q

In a Select Case structure, each _______ statement specifies a value for which the test expression is checked.

A

Case

126
Q

Since the first days of computers, the phrase “_______________” has described the fact that allowing incorrect input data into a program produces incorrect output.

A

garbage in, garbage out

127
Q

The IsNumeric function returns a(n) ______ type value.

A

Boolean

128
Q

Displays an OK button - default settin

A

MsgBoxStyle.OKOnly

129
Q

What is the value of MsgBox.OKOnly?

A

0

130
Q

Displays an OK and Cancel button

A

MsgBoxStyle.OKCancel

131
Q

Value of MsgBoxStylel.OKCancel

A

1

132
Q

After a failing situation the user can choose to Abort, Retry, or Ignore

A

MsgBoxStyle.AbortRetryIgnore

133
Q

value for MsgBoxStyle.AbortRetryIgnore

A

2

134
Q

Displays Yes, No and Cancel buttons, and its value

A

MsgBoxStyle.YesNoCancel, 3

135
Q

Displays Yes and No buttons, and value

A

MsgBoxStyle.YesNo, 4

136
Q

After an error occurs, the user can choose to Retry or Cancel, and its value

A

MsgBoxStyle.RetryCancel, 5

137
Q

A red circle with an X in it alerts the user to an error. How is it written and what is the value?

A

MsgBoxStyle.Critical, 16

138
Q

A blue circle with a question mark. How is it written and what is the value?

A

MsgBoxStyle.Question, 32

139
Q

A yellow triangle with an exclamation point alerts the user to a possible problem. How is it written and what is the value?

A

MsgBoxStyle.Exclamation, 48

140
Q

A blue circle with an exclamation point displays an information icon. How is it written and what is the value?

A

MsgBoxStyle.Information, 64

141
Q

Displays an OK button - default settin

A

MsgBoxStyle.OKOnly

141
Q

Displays Yes, No and Cancel buttons, and its value

A

MsgBoxStyle.YesNoCancel, 3

141
Q

After an error occurs, the user can choose to Retry or Cancel, and its value

A

MsgBoxStyle.RetryCancel, 5

141
Q

A blue circle with a question mark. How is it written and what is the value?

A

MsgBoxStyle.Question, 32

141
Q

What is the value of MsgBox.OKOnly?

A

0

141
Q

Displays an OK and Cancel button

A

MsgBoxStyle.OKCancel

141
Q

Value of MsgBoxStylel.OKCancel

A

1

141
Q

After a failing situation the user can choose to Abort, Retry, or Ignore

A

MsgBoxStyle.AbortRetryIgnore

141
Q

value for MsgBoxStyle.AbortRetryIgnore

A

2

141
Q

Displays Yes and No buttons, and value

A

MsgBoxStyle.YesNo, 4

141
Q

A red circle with an X in it alerts the user to an error. How is it written and what is the value?

A

MsgBoxStyle.Critical, 16

141
Q

A yellow triangle with an exclamation point alerts the user to a possible problem. How is it written and what is the value?

A

MsgBoxStyle.Exclamation, 48

141
Q

A blue circle with an exclamation point displays an information icon. How is it written and what is the value?

A

MsgBoxStyle.Information, 64