CPT187Test2 Flashcards

(153 cards)

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
What does the esc key do when using the Cancel button?
When the user presses the ESC key, the event handler processing for the button identified as the Cancel button will be executed.
26
What keyword is used when defining a variable?
Dim
27
When defining a variable, what goes at the end of the statement?
As and the declaration for the variable type being defined
28
Know the full statement setup.
Dim strNumberOfSongs As String
29
What is the assignment operator?
=
30
What does the blue squiggly line mean? green?
compile error, when a variable is declared it will be underlined with a green squiggly line until it is referenced in a statement
31
What is the scope of the variable?
specifies where within the program the variable can be referenced in a Visual Basic statement.
32
What is the lifetime of the variable?
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.
33
What does “Option Strict On” do?
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.
34
Know the symbols for arithmetic operators
+ 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
35
What is concatenation and what is the operator for using it?
The process of joining two different values into a single string. The ampersand (&).
36
When do Format Exception, Overflow Exception and Divide By Zero Exception occur?
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
37
allows the user to enter data into a program
TextBox object
38
allows the text in a TextBox object to be aligned left, right or center
TextAlign property
39
allows the user to enter multiple lines in the text box
MultiLine textbox
40
allows you to specify the data format for the value typed into the text box
MaskedTextBox
41
a procedure that performs its task but does not return a value.
Sub procedure
42
procedure that returns a value
function/Function procedure
43
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()
ToString function
44
clears any data currently placed in the Text property of a TextBox object. The general format is: txtTextboxName.Clear()
Clear procedure
45
When evaluating a condition it evaluates to
T or F
46
If Then statement can be used to compare arithmetic statement to
strings
47
And or Not, ____ has a higher precedence
Not
48
difference between radio button and checkbox
radio you can only choose one
49
What does the Checked property do?
sets to True or False
50
Features of a Panel object and what it performs
performs in the same manner as the GroupBox object
51
What are container objects used for?
have the purpose of grouping RadioButtons and other objects
52
Which container is used most often?
GroupBox
53
What are not available in Panel that are available in Groupbox?
caption, scroll bars, and labeled border
54
What objects are considered container objects?
GroupBox, Panel, FlowLayoutPanel, SplitContainer, TabControl, TableLayoutPanel
55
What options are available in message boxes? What types do what?
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")
56
What are the default?
MsgBox.OKOnly or 0
57
What is a decision structure used for?
to deal with the different conditions that occur based on the values entered into an application
58
A conditional statement is
results in either being true or false
59
What is the symbol for not equal to?
<>
60
What does every single If statement have to end with?
End If
61
When to use If Then statement
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
62
If Then Else statement?
executes a set of instructions if the statement is true. If False, the instructions under the Else is executed.
63
compound conditions are
more than one condition is included in an If Then Else statement.
64
how to create compound conditions
you must use a logical operator
65
When and how the And, Or, Not, Xor, AndAlso, OrElse, are used.
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
Select Case structures- How to end, what statement?
End Select
67
What a Case Else statement is and includes
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
keyword Is, when to use
when using relational operators in a Select Case statement
69
how many pieces of code snippets are contained in the code library?
500
70
What the function IsNumeric is used for
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
What does it return and what type of value?
True or False Boolean value
72
What the Show procedure in a MessageBox is used for
displays a message box window
73
Are unicode numbers less than letters?
yes
74
What is the order of letters and numbers in unicode?
numbers are less than uppercase letters which are less than lowercase letters
75
What logical And, Or , Not returns
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
GIGO
garbage in, garbage out
77
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.
As String
78
A ____________ beneath a variable name in a declaration statement indicates that the variable has not been used in the program.
green squiggly underline
79
A(n) __________ data type must be used in arithmetic operations.
numeric
80
The memory allocation for the Char data type is __________ bytes.
2
81
A(n) _______ variable should be used for values that will consist of a single character only.
Char
82
A prefix of _______ is used to denote a variable defined as an Integer data type.
int
83
A prefix of ______ is used to denote a variable defined as a Char data type.
chr
84
The dtm prefix is used to denote a(n)______ data type.
Date
85
The character D is the literal-type character for the __________ data type
Decimal
86
The ______ of a variable indicates how long the variable remains active.
lifetime
87
When using ________ division (\), any remainder amount is dropped or truncated.
integer
88
Used with the ToString function, the ____ format specifier will display the value 8967.43561 as 8,967.44.
Number
89
Used with the ToString function, the _________ format specifier will display the value 8967.43561 as 8967.43561.
General
90
The process of joining two string values together is called ______ .
concatenation
91
A(n) ______ Exception occurs when the user enters a value larger than the maximum value that can be processed by the statement.
Overflow
92
A(n) __________ object allows users to enter data into a program.
TextBox
93
the ________ property of a TextBox object controls the alignment of the text content.
TextAlign
94
The event handler of a button designed as the Accept button will be processed when the user presses the ________ key on the keyboard.
ENTER
95
A(n) _______ is a named location in RAM that can store a value that may change during program execution.
variable
96
A(n) _______ procedure does not return a value.
sub
97
A(n) __________ function is a procedure that returns a value when it is called.
function
98
The * operator is the ____________ arithmetic operator.
multiplication
99
The ______ procedure clears any data currently placed in the Text property of a TextBox object.
Clear
100
When a condition is tested in a Visual Basic program, this is a possible outcome:
the condition is true | the condition is false
101
When using multiple _____ operators in an If statement, the order of precedence of the operators should be established through the use of parentheses.
relational, logical
102
After the Not operator, the _______ logical operator has the next precedence.
And, AndAlso
103
Which of the following is a feature of the Panel object?
none of the above
104
The Panel object performs in the same manner as the ______ object.
GroupBox
105
The ___________ object provides several options not available with the Panel object.
GroupBox
106
The Panel, GroupBox, and TabControl objects are examples of __________ objects.
container
107
What is the value of the MsgBoxStyle.OKOnly?
0
108
A statement that tests a value is called a _______ statement
conditional
109
Use the ________ statement to execute one set of instructions if the condition is true, and another set of instructions if the condition is false.
If...Then...Else
110
The __________ of a variable means where a variable can be referenced within a program.
scope
111
To use multiple conditions in a single If...Then...Else statement, ______ conditions are required.
compound
112
An expression using the logical operator ______ will evaluate to true only when both of the conditions are true.
And
113
An expression using the logical operator ______ will evaluate to true when either of the compound conditions is true.
Or
114
The logical operator _____ has the highest priority and is evaluated first.
Not
115
To end a Select Case structure, a(n) _____ statement is used.
End Select
116
Which of the following CANNOT be contained in a code snippet?
an entire program
117
The ______ function is used to determine if an input value can be converted into a numeric value.
IsNumeric
118
If data analyzed by the IsNumeric function cannot be converted to a numeric data type, the function will return a value of ______.
False
119
The default setting for the MessageBoxButtons argument of a message box will display only a(n) ______ button in the message box.
OK
120
__________ is the MsgBoxButtons argument that displays the Yes and No buttons.
MsgBoxStyle.YesNo
121
If the condition tested in an If statement evaluates to _________ , the statement between the If and the End If keywords will be executed.
true
122
To test a second condition only after the result of the first condition is known, _________ If statements can be used.
nested
123
The logical operator ______ will return a value of true only if all conditions in a compound condition evaluate to true.
And
124
The logical operator _______ will return a value of true if at least one condition in a compound condition evaluates to true.
Or
125
In a Select Case structure, each _______ statement specifies a value for which the test expression is checked.
Case
126
Since the first days of computers, the phrase "_______________" has described the fact that allowing incorrect input data into a program produces incorrect output.
garbage in, garbage out
127
The IsNumeric function returns a(n) ______ type value.
Boolean
128
Displays an OK button - default settin
MsgBoxStyle.OKOnly
129
What is the value of MsgBox.OKOnly?
0
130
Displays an OK and Cancel button
MsgBoxStyle.OKCancel
131
Value of MsgBoxStylel.OKCancel
1
132
After a failing situation the user can choose to Abort, Retry, or Ignore
MsgBoxStyle.AbortRetryIgnore
133
value for MsgBoxStyle.AbortRetryIgnore
2
134
Displays Yes, No and Cancel buttons, and its value
MsgBoxStyle.YesNoCancel, 3
135
Displays Yes and No buttons, and value
MsgBoxStyle.YesNo, 4
136
After an error occurs, the user can choose to Retry or Cancel, and its value
MsgBoxStyle.RetryCancel, 5
137
A red circle with an X in it alerts the user to an error. How is it written and what is the value?
MsgBoxStyle.Critical, 16
138
A blue circle with a question mark. How is it written and what is the value?
MsgBoxStyle.Question, 32
139
A yellow triangle with an exclamation point alerts the user to a possible problem. How is it written and what is the value?
MsgBoxStyle.Exclamation, 48
140
A blue circle with an exclamation point displays an information icon. How is it written and what is the value?
MsgBoxStyle.Information, 64
141
Displays an OK button - default settin
MsgBoxStyle.OKOnly
141
Displays Yes, No and Cancel buttons, and its value
MsgBoxStyle.YesNoCancel, 3
141
After an error occurs, the user can choose to Retry or Cancel, and its value
MsgBoxStyle.RetryCancel, 5
141
A blue circle with a question mark. How is it written and what is the value?
MsgBoxStyle.Question, 32
141
What is the value of MsgBox.OKOnly?
0
141
Displays an OK and Cancel button
MsgBoxStyle.OKCancel
141
Value of MsgBoxStylel.OKCancel
1
141
After a failing situation the user can choose to Abort, Retry, or Ignore
MsgBoxStyle.AbortRetryIgnore
141
value for MsgBoxStyle.AbortRetryIgnore
2
141
Displays Yes and No buttons, and value
MsgBoxStyle.YesNo, 4
141
A red circle with an X in it alerts the user to an error. How is it written and what is the value?
MsgBoxStyle.Critical, 16
141
A yellow triangle with an exclamation point alerts the user to a possible problem. How is it written and what is the value?
MsgBoxStyle.Exclamation, 48
141
A blue circle with an exclamation point displays an information icon. How is it written and what is the value?
MsgBoxStyle.Information, 64