What displays in the label when the code below executes Dim

What displays in the label when the code below executes? Dim s As String = \"autumn_rain\" Dim index As Integer = s.IndexOf(\"_\") lb1.Out.Text = s.Substring (0, index) aut autumn autumn_ rain _rain A form contains two command buttons, each with its own Click event Sub procedure. Which statement is not true about variable x declared in the Click event Sub procedure for the first button? Code in both Click event Sub procedures may access variable x. Variable x is created each time the first button\'s Click event Sub procedure executes. The scope of variable x is restricted to the code of the first Click event Sub procedure. Variable x is referred to as a local variable. Which of the following functions returns an Integer value? CInt IndexOf FormatNumber Both choices a) and b). All choices a), b) and c). What is the output of the code: lb1Out.Text = FormatPercent (0.56813, 2) 0.57% 0.5681% 56.81% 57.00% Which of the following is not typically used as a control to gather input data from the user? InputBox MessageBox Text Box All three are typically used as input controls.

Solution

1. What displays in the label when the code below executes?
Dim s As String = \"autumn_rain\"           //Assigns the string to variable s.
Dim index As Integer = s.IndexOf(\"_\")   //Assigns the index of \"_\", i.e., 6 to integer index.
lblOut.Text = s.Substring(0, index)   //Prints the substring from index 0 to 5. i.e., autumn
So, the option is: b. autumn

2. A form contains two command buttons, each with its own Click event Sub procedure. Which
statement is not true about variable x declared in the Click event Sub procedure for the first button?
A variable x declared in the Click event Sub procedure for the first button is local to that procedure.
So, the answer is:
a. Code in both Click event Sub procedures may access variable x.

3. Which of the following functions returns an Integer value?
CInt function converts the input parameter to an Integer.
indexOf function returns the integer index of the string.
So, the answer is:
d. Both choices a) and b).

4. What is the output of the code: lblOut.Text = FormatPercent(0.56813, 2)
This will convert the value 0.56813 to a percent, with 2 decimal value precision.
So, the answer is:
c. 56.81%

5. Which of the following is not typically used as a control to gather input data from the user?
InputBox, and TextBox will take input from the user, where as, MessageBox will leave a message as output.
So, the answer is:
b. MessageBox.

 What displays in the label when the code below executes? Dim s As String = \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site