TAMU MMET 383 FINAL EXAM REVIEW
Result of B=7.2 Mod 3.8, where B is an integer? - Answer -B = 3
If the form has 3 radio buttons and one Button1, how do you make all 3 radio buttons
NOT checked when you start running the program? - Answer -Set the Tab Index of the
button to the lowfit number. Ex. 0
or
Set TabStop of each radio button to false
Write one line of code to generate a random number between 35 and 55 and store it in
a variable called RC. - Answer -RC = CInt(Int(Rnd()*(55-35) + 35))
What does the following sentence display in the Textbox1?
Textbox1.Text = "Jerry" & VBNewline & VBNewline & "Smith" - Answer -Jerry
Smith
Write four lines of code to swap between two different variables A and B, where Temp is
another variable, including declaration of variables. - Answer -Dim A, B, Temp as string
Temp = A
A=B
B = Temp
Different data types that a variable can be assigned to. - Answer -String, Decimal,
Double, Integer, Long, Short, Single
Give a one line example of the MsgBox function. - Answer -MsgBox("This will read in a
pop-up box")
What function key can be used to run a program one line at a time? - Answer -F8 or
F11
Function to check if a textbox entry is a numerical value or not. - Answer -
IsNumerical(TextBox1.Text)
Two functions that can be used to convert a String variable to a numeric variable, and
write a line of code that illustrates how to use each function. Assume the string is
Textbox1.Text - Answer -CDec(Expression)
CInt(Expression)
A= CDec(Textbox1.Text)
B= CInt(Textbox1.Text)
, Convert from Numeric to String. Write a line of code - Answer -TextBox1.Text = Format
(A, "0.00")
or
TextBox1. Text = CStr(A)
arithmetic operators - Answer -Exponential ^
Negation Unary-
Multiplication *
Division /
Integral Division \
Modulus Arithmetic MOD
Addition +
Subtraction -
Order of precedence of arithmetic operators - Answer -1. Exponential
2. Negation
3. Multi/Divis
4. Integer Division
5. Modulus arithmetic
6. Add/Sub
Variable Scope of Private - Answer -Form Level: works for all subroutines
Variable Scope of Dim - Answer -Subroutine level: works only for specified subroutine
Variable Scope of Public - Answer -Project Level: works for entire project
Comparison operators and expressions - Answer -Equal to =
Not equal to <>
Less than <
Greater than >
Less than or equal to <=
Greater than or equal to >=
Comparing strings to strings - Answer -Less than means comes before alphabetically
Greater than mean comes after alphabetically
General rule: 0<9<A<Z<a<z
Ex. "123" < "9"
Logic Operators - Answer -And, Or, Not
What is a "Procedure"? - Answer -Any sequence of statements that has a name and is
executed in a unit
What does the symbol <> mean? - Answer -Not equal
Result of B=7.2 Mod 3.8, where B is an integer? - Answer -B = 3
If the form has 3 radio buttons and one Button1, how do you make all 3 radio buttons
NOT checked when you start running the program? - Answer -Set the Tab Index of the
button to the lowfit number. Ex. 0
or
Set TabStop of each radio button to false
Write one line of code to generate a random number between 35 and 55 and store it in
a variable called RC. - Answer -RC = CInt(Int(Rnd()*(55-35) + 35))
What does the following sentence display in the Textbox1?
Textbox1.Text = "Jerry" & VBNewline & VBNewline & "Smith" - Answer -Jerry
Smith
Write four lines of code to swap between two different variables A and B, where Temp is
another variable, including declaration of variables. - Answer -Dim A, B, Temp as string
Temp = A
A=B
B = Temp
Different data types that a variable can be assigned to. - Answer -String, Decimal,
Double, Integer, Long, Short, Single
Give a one line example of the MsgBox function. - Answer -MsgBox("This will read in a
pop-up box")
What function key can be used to run a program one line at a time? - Answer -F8 or
F11
Function to check if a textbox entry is a numerical value or not. - Answer -
IsNumerical(TextBox1.Text)
Two functions that can be used to convert a String variable to a numeric variable, and
write a line of code that illustrates how to use each function. Assume the string is
Textbox1.Text - Answer -CDec(Expression)
CInt(Expression)
A= CDec(Textbox1.Text)
B= CInt(Textbox1.Text)
, Convert from Numeric to String. Write a line of code - Answer -TextBox1.Text = Format
(A, "0.00")
or
TextBox1. Text = CStr(A)
arithmetic operators - Answer -Exponential ^
Negation Unary-
Multiplication *
Division /
Integral Division \
Modulus Arithmetic MOD
Addition +
Subtraction -
Order of precedence of arithmetic operators - Answer -1. Exponential
2. Negation
3. Multi/Divis
4. Integer Division
5. Modulus arithmetic
6. Add/Sub
Variable Scope of Private - Answer -Form Level: works for all subroutines
Variable Scope of Dim - Answer -Subroutine level: works only for specified subroutine
Variable Scope of Public - Answer -Project Level: works for entire project
Comparison operators and expressions - Answer -Equal to =
Not equal to <>
Less than <
Greater than >
Less than or equal to <=
Greater than or equal to >=
Comparing strings to strings - Answer -Less than means comes before alphabetically
Greater than mean comes after alphabetically
General rule: 0<9<A<Z<a<z
Ex. "123" < "9"
Logic Operators - Answer -And, Or, Not
What is a "Procedure"? - Answer -Any sequence of statements that has a name and is
executed in a unit
What does the symbol <> mean? - Answer -Not equal