CPT187Test2 Flashcards
_______ is an arithmetic operation.
division, addition, multiplication
The Decimal data type can represent __________
dollar amounts, very precise decimal numbers, large numbers
A _____ can be represented by using the Char data type.
letter, punctuation symbol, symbol
The prefix ______ should be used for naming a TextBox object.
txt
The event handler of a button designated as the Cancel button will be processed when the user presses the ______ key on the keyboard.
ESC
Where is a variable stored and what is it?
A variable is a named location in RAM where data is stored.
What data types have one byte?
byte
What data types have 2 bytes?
char, short, Boolean
What data types have 4 bytes?
integer, object and single
what data types have 8 bytes?
Double, Date, Long
What data type occupy 16 bytes?
Decimal
abbr for String
str
abbr for Integer
int
abbr for Decimal
dec
abbr for Double
dbl
abbr for Char
chr
abbr for Boolean
bln
abbr for Byte
byt
abbr for Date
dtm
abbr for Long
lng
abbr for Short
shr
abbr for Single
sng
What are the prefixes for each object?
TextBox object and MaskedTextBox object, txt
What is the difference between the accept, cancel, and focus and what do they do?
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.
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.
What keyword is used when defining a variable?
Dim
When defining a variable, what goes at the end of the statement?
As and the declaration for the variable type being defined
Know the full statement setup.
Dim strNumberOfSongs As String
What is the assignment operator?
=
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
What is the scope of the variable?
specifies where within the program the variable can be referenced in a Visual Basic statement.
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.
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.
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
What is concatenation and what is the operator for using it?
The process of joining two different values into a single string. The ampersand (&).
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
allows the user to enter data into a program
TextBox object
allows the text in a TextBox object to be aligned left, right or center
TextAlign property
allows the user to enter multiple lines in the text box
MultiLine textbox
allows you to specify the data format for the value typed into the text box
MaskedTextBox
a procedure that performs its task but does not return a value.
Sub procedure
procedure that returns a value
function/Function procedure
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
clears any data currently placed in the Text property of a TextBox object. The general format is: txtTextboxName.Clear()
Clear procedure
When evaluating a condition it evaluates to
T or F
If Then statement can be used to compare arithmetic statement to
strings
And or Not, ____ has a higher precedence
Not
difference between radio button and checkbox
radio you can only choose one
What does the Checked property do?
sets to True or False
Features of a Panel object and what it performs
performs in the same manner as the GroupBox object
What are container objects used for?
have the purpose of grouping RadioButtons and other objects
Which container is used most often?
GroupBox
What are not available in Panel that are available in Groupbox?
caption, scroll bars, and labeled border
What objects are considered container objects?
GroupBox, Panel, FlowLayoutPanel, SplitContainer, TabControl, TableLayoutPanel
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”)
What are the default?
MsgBox.OKOnly or 0
What is a decision structure used for?
to deal with the different conditions that occur based on the values entered into an application
A conditional statement is
results in either being true or false
What is the symbol for not equal to?
<>
What does every single If statement have to end with?
End If
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