Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
92 Cards in this Set
- Front
- Back
- 3rd side (hint)
String Concatenation
|
One string appended to another.
Ex. lblMessage.Text = "Good morning" & "Charlie" |
|
|
Line-continuation character
|
A space followed by an underscore character; used to break a long programming statement into two or more lines.
|
|
|
Focus
|
The control that has the focus is the one that receives the user's keyboard input or mouse clicks.
|
|
|
Focus method
|
ControlName.Focus( )
*Where ControlName is the name of the control. EX: txtDayOfTheWeek.Focus( ) |
|
|
Tab Order
|
The order in which controls receive the focus.
|
|
|
TabIndex property
|
Contains a numeric value, which indicates the control's position in the tab order.
|
|
|
Access Key
|
A key that is pressed in combination with the ALT key; access keys allow the user to access buttons and menu items using the keyboard; also known as a mnemonic.
|
|
|
Mnemonic
|
A key that is pressed in combination with the ALT key; access keys allow the user to access buttons and menu items using the keyboard; also known as a Access key.
|
|
|
Accept Button
|
A button on a form that is clicked when the user presses the ENTER key.
|
|
|
Cancel Button
|
A button on a form that is clicked when the user presses the ESC key.
|
|
|
What TextBox property holds text entered by the user?
|
Text
|
|
|
Assume an application has a label named lblMessage and a TextBox control named txtInput. Write the statement that takes test the user entered into the TextBox control and assigns it to the label's Text property.
|
lblMessage.Text = txtInput.Text
|
|
|
If the following statement is executed, what will the lblGreeting control display?
lblGreeting.Text = "Hello " & "Jonathon, " & "how are you?" |
Hello Jonathon, how are you?
|
|
|
What is the line-continuation character, and what does it do?
|
It is actually two characters: a space followed by an underscore character. It allows you to break a long programming statement into two or more lines.
|
|
|
What is meant when it is said that a control has the focus?
|
The control is accepting keyboard and/or mouse input from the user.
|
|
|
Write a statement that gives the focus to the txtLastName control.
|
txtLastName.Focus( )
|
|
|
What is meant by tab order?
|
The order in which controls receive the focus when the user presses the TAB key.
|
|
|
How does the TabIndex property affect the tab order?
|
The TabIndex property, which contains numeric value, determines the position of a control in the tab order. The control that has the lowest TabIndex value (usually 0) on a form is the first in the tab order. The control with the next highest TabIndex (usually 1) will be the next in the tab order. This sequence continues.
|
|
|
How does Visual Basic normally assign the tab order?
|
In the order that controls are created.
|
|
|
What happens when a control's TabStop property is set to False?
|
That control is skipped in the tab order.
|
|
|
Assume a button's Text property is set to the text Show &Map. What effect does the & character have?
|
The & character has two different effects: It assigns an access key to the button (in this case, the access key is ALT+M because the & is in front of the M) and it causes the M to appear underlined on the button.
|
|
|
What is an accept button? What is a cancel button? How do you establish these buttons on a form?
|
An accept button is a form's button that is clicked when the user presses the ENTER key. A cancel button is a form's button that is clicked when the user presses the ESC key. You select accept and cancel buttons with the form's AcceptButton and CancelButton properties.
|
|
|
Variable
|
A storage location in computer memory that holds data while a program is running.
*It is called a variable because the data it holds can be changed by statements in the program. |
|
|
Code Outlining
|
A Visual Studio tool that lets you expand and collapse sections of code.
|
|
|
Naming Conventions
|
Guidelines based on recommendations of professional designers, programmers, and educators.
*If you follow consistent naming convention, your program source code will be easier to read and understand. |
|
|
bln
|
Boolean
Ex. blnContinue, blnHasRows |
|
|
byt
|
Byte
Ex. bytInput, bytCharVal |
|
|
Chr
|
Char
Ex. chrSelection, chrMiddleInitial |
|
|
dat or dtm
|
Date, DateTime
Ex. datWeeklySalary, decGrossPay |
|
|
dec
|
Decimal
Ex. decWeeklySalary, decGrossPay |
|
|
dbl
|
Double
Ex. dblAirVelocity, dblPlanetMass |
|
|
int
|
Integer
Ex. intCount, intDaysInPayPeriod |
|
|
lng
|
Long
Ex. lngElapsedSeconds |
|
|
obj
|
Object
Ex. objStudent, objPayroll |
|
|
shrt
|
Short
Ex. shrtCount |
|
|
sng
|
Single
Ex. sngTaxRate, sngGradeAverage |
|
|
str
|
String
Ex. strLastName, strAddress |
|
|
Initialization
|
Specifying an initial value for a variable.
|
|
|
What is a variable?
|
A variable is a storage location in the computer's memory; used for holding information while the program is running.
|
|
|
Show an example of a variable declaration.
|
Dim intCount As Integer
|
|
|
Which of the following variable names are written with the convention used in this book?
decintrestrate InterestRateDecimal decInterestRate |
decInterestRate is written with the convention used in this book.
|
|
|
Indicate whether each of the following is a legal variable name. If it is not, explain why.
count rate*Pay deposit.amount down_payment |
count = Legal
rate*Pay = Illegal; cannot use the * character deposit.amount = Illegal; cannot use a period down_payment = Legal, however, the name does not follow the standard convention or using a prefix to indicate its data type. |
|
|
What default value is assigned to each of the following variables?
Integer Single Boolean Byte Date |
Integer = 0
Single = 0.0 Boolean = False Byte = 0 Date = 12:00:00 AM, January 1 of year 1 |
|
|
Write a Date literal for the following date and time: 5:35:00 PM on February 20, 2008.
|
#2/20/2008 5:35 PM
|
|
|
Which famous Microsoft programmer was launched into space in early 2007. Was this programmer connected in any way to Visual Basic?
|
Charles Simonyi
Yes, he developed the Hungarian notation convention. |
|
|
Unary Operator
|
Requires only a single operand
Ex. -5 -intCount |
|
|
Binary Operator
|
Works with two operands
Ex. 5+10 intA +intB |
|
|
Name the following operators:
+ - * / \ MOD ^ |
Addition
Subtraction Multiplication Floating-point division Integer division Modulus (remainder from integer division) Exponentiation (x^y = X to the power of Y) |
|
|
Now
|
Returns the current date and time from system.
|
|
|
TimeOfDay
|
Returns the current time from the system, without the date.
|
|
|
Today
|
Returns the current date from the system, without the time.
|
|
|
Scope
|
refers to the part of a program where the variable is visible and may be accessed by programming statements.
|
|
|
Combined Assignment Operators
(Compound Operators) |
Combine an arithmetic operator with an assignment operator.
|
|
|
Precedence of the Arithmetic Operators
|
-Exponentiation ( the ^ operator)
-Multiplication and division ( the * and / operators) -Integer division (the \ Operator) -Modulus (the MOD operator) -Addition and subtraction (the + and - operators) |
|
|
What value will be stored in dbleResult after each of the following statements executes?
dblResult = 6 + 3 * 5 dblResult = 12 / 2 - 4 dblResult = 2 + 7 * 3 dblResult = (2 + 4) * 3 dblResult = 10 \ 3 dblResult = 6 ^ 2 |
21
2 17 18 3.0 36 |
|
|
What value will be stored in the int Result after each statement executes?
intResult = 10 MOD 3 intResult = 47 MOD 15 |
1
2 |
|
|
Write a statement that assigns the current time of day to the variable
dtmThisTime |
dtmThisTime = TimeOfDay
|
|
|
Write a statement that assigns the current date and time to a variable named dtmCurrent
|
dtmCurrent = Now
|
|
|
Explain the meaning of the term scope when applied to variables.
|
Scope defines the area of a program in which a variable or method is visible.
|
|
|
What will be the final value of dblResult in the following sequence?
Dim dblResult As Double = 3.5 dblResult += 1.2 |
dblResult = 4.7
|
|
|
What will be the final value of dblResult in the following sequence?
Dim dblResult As Double = 3.5 dblResult *= 2.0 |
dblResult = 7.0
|
|
|
Implicit Type Conversion
|
When you assign a value of one data type, Visual Basic attempts to convert the value being assigned to the data type of the variable.
|
|
|
Widening Conversion
|
A conversion in which no data is lost.
|
|
|
Narrowing Conversion
|
If you assign a real number to an integer variable, Visual Basic attempts to perform this conversion, which sometimes results in lost data.
|
|
|
Option Strict
|
In Visual Basic, a configuration option that determines whether certain implicit conversions are legal.
|
|
|
Type:
Boolean |
Description:
Keywords True and False |
Example:
True |
|
Type:
Byte |
Description:
Sequence of decimal digits between 0 and 255 |
Example:
200 |
|
Type:
Char |
Description:
Single letter enclosed in double quotes followed by the lowercase letter C |
Example:
"A"c |
|
Type:
Date |
Description:
Date and/or time representation enclosed in # symbols |
Example:
#1/20/05 3:15 PM# |
|
Type:
Decimal |
Description:
Optional leading sign, sequence of decimal digits, optional decimal point and trailing digits, followed by the letter D or @ |
Example:
64@ |
|
Type:
Double |
Description:
Optional leading sign, sequence of digits with a decimal point and trailing digits, followed by the optional letter R |
Example:
3.5R |
|
Type:
Integer |
Description:
Optional leading sign, sequence of decimal digits, followed by the optional letter I |
Example:
-3054I |
|
Type:
Long |
Description:
Optional leading sign, sequence of decimal digits, followed by the letter L |
Example:
40000000L |
|
Type:
Short |
Description:
Optional leading sign, sequence of decimal digits, followed by the letter S |
Example:
12345S |
|
Type:
Single |
Description:
Optional leading sign, sequence of digits with a decimal point and trailing digits, followed by the letter For ! |
Example:
26.4F 26.4! |
|
Type:
String |
Description:
Sequence of characters surrounded by double quotes |
Example:
"ABC" "234" |
|
Named Constant
|
A variable whose content is read-only, and cannot be changed by a programming statement while the program is running.
|
Const ConstantName As DataType = Value
Ex. Const dblINTEREST_RATE As Double = 0.129 |
|
Function
|
A named, self-contained body of code, to which you send some input.
|
|
|
CDate ( expr )
|
Converts a String expression to a Date. Input can also be a Date literal, such as "10/14/2009 1:30PM"
|
Ex.
Dim datBirthday As Date = CDate (txtBirthday.Text) |
|
CDbl ( expr )
|
Converts an expression to a Double. If the input expression is a String, a leading currency symbol ($) is permitted, as are commas. The decimal point is optional.
|
Ex.
Dim dblSalary As Double = CDbl (txtPayRate.txt) |
|
CDec ( expr )
|
Converts an expression to an Integer. If the input expression is a string, a leading currency ($) is permitted, as are commas. The decimal point is optional, as are digits after the decimal point.
|
Ex.
Dim decPayRate As Decimal = CDec (txtPayRate.Text) |
|
CStr ( expr )
|
Converts an expression to a String. Input can be a mathematical expression, Boolean value, a date, or any numeric data type.
|
Ex.
Dim dblPayRate As Double Dim decPayRate As Decimal = CDec (dblPayRate) |
|
Exception
|
An event or condition that happens unexpectedly and causes the application to halt.
|
|
|
After the statement dblResult = 10 \3 executes, what value will be stored in dblResult?
|
dblResult = 3.0
|
|
|
After each of the following statements executes, what value will be stored in dblResult?
dblResult = 6 + 3 * 5 dblResult = 12 /2 - 4 dblResult = 2 + 7 * 3 - 6 dblResult = (2 + 4) * 3 |
21
2 17 18 |
|
|
What value will be stored in dblResult after the following statement executes?
dblResult = CInt ("28.5") |
dblResult = 28
|
|
|
Will the following statement execute or cause a runtime error?
dblResult = CDbl ("186.478.39") |
dblResult = 186478.39
|
|
|
What is a named constant?
|
An identifier (like a variable) that is given a type and a constant value.
|
|
|
Assuming that intNumber is an integer variable, what value will each of the following statements assign to it?
intNumber = 27 intNumber = Cint (12.8) intNumber = CInt (12.0) intNumber = (2 + 4) * 3 |
27
12 58 13 |
|
|
When does a type conversion runtime error occur? ( Assume Option Strict is Off)
|
When the value being assigned cannot be converted to the type of the destination variable.
|
|
|
Excluding the Val( ) function, which function converts the string "860.2" to value of type Double?
|
CDBI Function
|
|
|
How would the following strings be converted by the CDec function?
48.5000 $34.95 2,300 Twelve |
48 (Roundup to the nearest even integer)
25 (rounds up) 2300 **cannot be converted** |
|