Q. In visual basic language what are the rules of a programming language called?

  • (A) Grammar
  • (B) Order
  • (C) Syntax
  • (D) Rules
πŸ’¬ Discuss
βœ… Correct Answer: (C) Syntax
Explanation: In the context of programming languages, the rules that dictate how programs are written and structured are referred to as Syntax. Syntax defines the correct arrangement of symbols, keywords, and other elements in a programming language to create valid and meaningful code. It governs how statements should be formed and how different parts of a program interact with each other.

Q. In Visual Basic, if you keep a variable undeclared, it is automatically taken as. . . . . . . . data type.

  • (A) Int
  • (B) Char
  • (C) String
  • (D) Object
πŸ’¬ Discuss
βœ… Correct Answer: (D) Object
Explanation: In Visual Basic, if you keep a variable undeclared, it is automatically taken as the Object data type. This means that the variable can hold any type of value, as Object is the base class for all data types in Visual Basic. While this can provide flexibility, it also means that the compiler won't be able to perform type checking or provide compile-time type-related optimizations for the variable. It's generally considered good practice to explicitly declare the data type of variables to ensure clarity and avoid potential issues related to type conversion.

Q. In Visual Basic, which of the following is used for coding single-alternative and dual-alternative selection structures?

  • (A) Switch-Case block
  • (B) If...Then...Else statement
  • (C) function overloading
  • (D) Recursion
πŸ’¬ Discuss
βœ… Correct Answer: (B) If...Then...Else statement
Explanation: In Visual Basic, the If...Then...Else statement is used for coding single-alternative and dual-alternative selection structures.

Q. In Visual Basic, which of the following method converts a string to a number?

  • (A) Convert
  • (B) Tryparse
  • (C) Extern
  • (D) Parse
πŸ’¬ Discuss
βœ… Correct Answer: (B) Tryparse
Explanation: In Visual Basic, the TryParse method is used to convert a string to a number while handling potential errors that might occur during the conversion. This method is commonly used when you want to attempt the conversion without causing an exception if the conversion fails.

Q. String comparison in Visual basic is case-sensitive.

  • (A) True
  • (B) boolean
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (A) True
Explanation: In Visual Basic, string comparison is case-sensitive. This means that when you compare two strings, the comparison takes into account the exact letter case of each character in the strings.

Q. . . . . . . . . is the default Visual Basic data type

  • (A) string
  • (B) Project Window
  • (C) variant
  • (D) date
πŸ’¬ Discuss
βœ… Correct Answer: (C) variant
Explanation: In Visual Basic, the default data type is variant. A variant is a data type that can hold any type of data. It's a flexible data type that can store numbers, strings, dates, and other types of values. However, while it provides flexibility, it can also lead to some performance overhead and potential type-related issues.

Q. Variables are used to temporarily store data during execution of application.

  • (A) TRUE
  • (B) 5
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (A) TRUE

Q. 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.

  • (A) 0
  • (B) Mark
  • (C) 6
  • (D) 8
πŸ’¬ Discuss
βœ… Correct Answer: (A) 0

Q. What will be the content of Text after the code is executed with id=8?
If id==1 Then
Text="Janet";
Elseif id==2 OrElse id==3 Then
Text="Mark"
ElseIF id==4 Then
Text="Jerry"
Else
Text="Sue ";
EndIf

  • (A) Janet
  • (B) Dynamic
  • (C) Jerry
  • (D) Sue
πŸ’¬ Discuss
βœ… Correct Answer: (D) Sue

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

  • (A) Changing
  • (B) child
  • (C) Static
  • (D) Scalar
πŸ’¬ Discuss
βœ… Correct Answer: (D) Scalar