Explore topic-wise MCQs in Visual Basic.

This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Visual Basic knowledge and support exam preparation. Choose a topic below to get started.

1.

In most applications, the code to define a user-defined data type is entered in the form s.

A. Declarations section
B. Definition section
C. Load event procedure
D. User-defined section
Answer» B. Definition section
2.

An application uses a structure named Employee. Which of the following statements declares a five-element array of Employee structure variables?

A. Dim workers(4) As Employee
B. Dim workers(5) As Employee
C. Dim workers As Employee(4)
D. Dim workers As Employee(5)
Answer» C. Dim workers As Employee(4)
3.

An array is declared using the statement Dim inventory(4) As Product. Which of the following statements assigns the number 100 to the intQuantity member variable contained in the last array element?

A. inventory.intQuantity(4) = 100
B. inventory(4).Product.intQuantity = 100
C. inventory(3).intQuantity = 100
D. inventory(4).intQuantity=100
Answer» D. inventory(4).intQuantity=100
4.

A structure variable named address contains a member variable named strStreet. Which of the following statements assigns the string Maple to the member variable?

A. address&strStreet = Maple
B. address.strStreet = Maple
C. strStreet.address = Maple
D. strStreet&address= Maple
Answer» C. strStreet.address = Maple
5.

Which statement is used to create a user-defined data type?

A. Declare
B. Define
C. Struct
D. UserType
Answer» D. UserType
6.

Programmers use ________________ when they need to store related items in an array, even though the members have different data type.

A. Structure variable
B. Variable
C. Auto variable
D. Constant variable
Answer» B. Variable
7.

Programmers use _________________ when they need to pass a group of related variables.

A. Structure variable
B. Variable
C. Auto variable
D. Constant variable
Answer» B. Variable
8.

You refer to the member variable by preceding its name with the name of the _________________________ in which it is defined.

A. Variable
B. Auto variable
C. Structure variable
D. Constant variable
Answer» D. Constant variable
9.

You refer to the structure variable by its ____________

A. Name
B. Data type
C. Dot operator
D. Member name
Answer» B. Data type
10.

Variables declared using a structure is known as ___________________

A. Variables
B. Auto variables
C. Structure variables
D. Constant variables
Answer» D. Constant variables