VB.Net MCQ Quiz Hub

VB.Net Mcq Question Set 9

Choose a topic to test your knowledge and improve your VB.Net skills

If the padCharacter is omitted from the syntax of the padLeft or PadRight, the default is ______





✅ Correct Answer: 1

The _______ method pads the string on left, that is, it inserts the padded characters at the beginning of string.





✅ Correct Answer: 1

To determine whether a string has specific sequence of characters, use _________





✅ Correct Answer: 1

The ________ argument in syntax of Contains method represents the sequence of arguments you are searching.





✅ Correct Answer: 1

The Contains Method returns ______________ value.





✅ Correct Answer: 3

The Indexof method returns _________ value.





✅ Correct Answer: 1

What output will be returned if the following Visual Basic code is executed? strCityState = "Nashville, TN" blnIsContained = strCityState.Contains("TN")





✅ Correct Answer: 1

What output will be returned if the following Visual Basic code is executed? strCityState = "Nashville, TN" intCharIndex = strCityState.IndexOf("TN")





✅ Correct Answer: 3

What output will be returned if the following Visual Basic code is executed? strCityState = "Nashville, TN" intCharIndex = strCityState.IndexOf("Tn")





✅ Correct Answer: 4

______ method is used for accessing any number of characters in a String.





✅ Correct Answer: 1

_______ argument in the Substring syntax specifies number of characters you want to access.





✅ Correct Answer: 1

The _______ operator allows you to use pattern matching characters to determine whether one String is equal to another String.





✅ Correct Answer: 1

The ______ in a pattern represents one character only.





✅ Correct Answer: 1

The ______ in a pattern represents zero or more characters.





✅ Correct Answer: 2

The _______ in a pattern represents a single digit.





✅ Correct Answer: 3

The Like operator returns _______________ value.





✅ Correct Answer: 2

Which of the following expressions evaluates to True when the strPart variable contains the string “123X45”?





✅ Correct Answer: 3

In the following code, the while loop will execute if strId would have been ______ Do While strId Like "###*"





✅ Correct Answer: 1

In the following code, the body of If will execute if txtState.Text contains? If txtState.Text Like "K*" Then





✅ Correct Answer: 1

In the following code, the body of If will execute if strFirst contains? If strFirst.ToUpper Like "B?LL" Then





✅ Correct Answer: 1

In the following code, the body of If will execute if strFirst contains? If strFirst.ToUpper Like "T[OI]M" Then





✅ Correct Answer: 1

You use _______ to include one or more menus on a Windows form.





✅ Correct Answer: 2

The list of items displayed by menu title are known as _______





✅ Correct Answer: 3

Each of the options on the submenu are referred to as ________





✅ Correct Answer: 2

________ is used to visually group together related items on a menu or submenu.





✅ Correct Answer: 2

Each menu element is considered as _______





✅ Correct Answer: 2

The programmer use _______ property to refer to menu element in code.





✅ Correct Answer: 3

The ____________ indicates the purpose of the menu element.





✅ Correct Answer: 1

______ capitalization is used for menu item captions.





✅ Correct Answer: 1

Each menu title should have an unique __________





✅ Correct Answer: 1

Each menu item should have an _______ that is unique within its menu.





✅ Correct Answer: 1

A simple variable, also called as a ________ variable, is one that is unrelated to any other variable in memory.





✅ Correct Answer: 4

When you group together related variables, the group is referred to as _________





✅ Correct Answer: 1

Using array in a program is efficient because ________





✅ Correct Answer: 4

Data in an array can be distinguished using _______ number.





✅ Correct Answer: 2

If array is of String type all values are _________ by default.





✅ Correct Answer: 4

The act of initializing array is also called as _______





✅ Correct Answer: 1

What is the value of len in the following Visual Basic code? Dim strCities() As String = {"Bombay", "Chennai", "Ladakh", "Tamil Nadu"} Dim len As Integer len = strCities.Length()





✅ Correct Answer: 1

What is wrong with the following statement? Dim strCities As String = {"Bombay", "Chennai", "Ladakh", "Tamil Nadu"}





✅ Correct Answer: 4

What is the result of the following statements? Dim strCities() As String = {"Bombay", "Chennai", "Ladakh", "Tamil Nadu"} strCities(2)=”Kolkata”





✅ Correct Answer: 4

Which of the following declares a five-element one-dimensional array?





✅ Correct Answer: 4

The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. The statement intSales(3) = intSales(3) + 10 will .





✅ Correct Answer: 2

The strItems array is declared as follows: Dim strItems(20) As String. The intSub variable keeps track of the array subscripts and is initialized to 0. Which of the following Do clauses will process the loop instructions for each element in the array?





✅ Correct Answer: 2

The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. Which of the following If clauses determines whether the intSub variable contains a valid subscript for the array?





✅ Correct Answer: 2

The intNums array is declared as follows: Dim intNums() As Integer = {10, 5, 7, 2}. Which of the following blocks of code correctly calculates the average value stored in the array? The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.





✅ Correct Answer: 2

The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. Which of the following loops will correctly add 100 to each array element? The intSub variable contains the number 0 before the loops are processed.





✅ Correct Answer: 3

What will be assigned to the dblAvg variable after the code has been executed? Do While intSub < 4 intNums(intSub) = intTotal + intTotal intSub = intSub + 1 Loop dblAvg = intTotal / intSub Dim intNums() As Integer = {10, 5, 7, 2}. The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.





✅ Correct Answer: 1

What will be assigned to the dblAvg variable after the code has been executed? Do While intSub < 4 intTotal = intTotal + intNums(intSub) intSub = intSub + 1 Loop dblAvg = intTotal / intSub Dim intNums() As Integer = {10, 5, 7, 2}. The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.





✅ Correct Answer: 3

What will be assigned to the dblAvg variable after the code has been executed? Do While intSub < 4 intTotal = intTotal + intNums(intSub) intSub = intSub + 1 Loop dblAvg = intTotal / intSub – 1 Dim intNums() As Integer = {10, 5, 7, 2}. The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.





✅ Correct Answer: 2

What will be assigned to the dblAvg variable after the code has been executed? Do While intSub < 4 intTotal = intTotal + intNums(intSub) intSub = intSub + 1 Loop dblAvg = intTotal / (intSub − 1) Dim intNums() As Integer = {10, 5, 7, 2}. The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.





✅ Correct Answer: 4