Q. What will contain in txtFirst after the following Visual Basic code is executed?

Code:
strName = "Penny Swanson"
txtFirst.Text = strName.Remove(5)
  • (A) Penny
  • (B) Swanson
  • (C) Penny S
  • (D) y Swanson
πŸ’¬ Discuss
βœ… Correct Answer: (A) Penny
Explanation: The Remove method in Visual Basic removes a specified number of characters from a string starting from the beginning. In this code snippet, strName is assigned the value "Penny Swanson". Then, the Remove method is used to remove characters from the beginning of strName.

Q. In VB, The . . . . . . . . first we check the condition, if the condition is true then it execute the true statement same as while condition .

  • (A) for loop
  • (B) do while
  • (C) if condition
  • (D) nested
πŸ’¬ Discuss
βœ… Correct Answer: (A) for loop

Q. A . . . . . . . . provides an area in the form for the user to enter data.

  • (A) Text box
  • (B) Button
  • (C) Edit box
  • (D) Label
πŸ’¬ Discuss
βœ… Correct Answer: (A) Text box

Q. Which of the following is called the line continuation character?

  • (A) *
  • (B) ^
  • (C) -
  • (D) _
πŸ’¬ Discuss
βœ… Correct Answer: (D) _

Q. Declaring a variable tell the computer to allocate a memory space that can be accessed by the variable name. The size of the memory space depends on?

  • (A) Length of variable name
  • (B) Data type of the variable
  • (C) Location of variable in program
  • (D) Size of memory in computer
πŸ’¬ Discuss
βœ… Correct Answer: (B) Data type of the variable

Q. A . . . . . . . . is defined as a zero or more characters enclosed in quotation marks.

  • (A) String
  • (B) Number
  • (C) Floating point integer
  • (D) Integer
πŸ’¬ Discuss
βœ… Correct Answer: (A) String

Q. What output will be returned if the following Visual Basic code is executed?

Code:
strCityState = "Nashville, TN"
blnIsContained = strCityState.Contains("TN")
  • (A) True
  • (B) False
  • (C) 11
  • (D) 12
πŸ’¬ Discuss
βœ… Correct Answer: (A) True

Q. In . . . . . . . . first we execute the true statement . then we check the condition if the condition is true then it again execute the true statement .

  • (A) while
  • (B) do while
  • (C) if condition
  • (D) nested
πŸ’¬ Discuss
βœ… Correct Answer: (B) do while

Q. Which of the following expressions evaluates to True when the strPart variable contains the string "123X45"?

  • (A) strPart Like "999[A-Z]99"
  • (B) strPart Like "######"
  • (C) strPart Like "###[A-Z]##"
  • (D) strPart Like "##??##"
πŸ’¬ Discuss
βœ… Correct Answer: (C) strPart Like "###[A-Z]##"

Q. The . . . . . . . . keyword indicates that an application can set the property's value, but it cannot retrieve the value.

  • (A) Receive
  • (B) Write
  • (C) WriteOnly
  • (D) ReceiveOnly
πŸ’¬ Discuss
βœ… Correct Answer: (C) WriteOnly