Alien head

Visual Basic (VB) .net Quiz - 1

Description: Visual Basic (VB) .net Quiz - 1
Number of Questions: 10
Created by:
Tags: .net vb

Which is not an optional element of a sub procedure declaration?

  1. Parameters

  2. Public

  3. Private

  4. Statements

  5. Sub

Answer: 5

Which is a valid way to write a sub procedure declaration?

  1. Use the Class and Method combo boxes in the Code Editor window.

  2. Double click on the object in the Form Designer window.

  3. Type the procedure declaration in the Code Editor window.

  4. Both a and b.

  5. All of the above.

Answer: 3

Which statement will send the value generated by a function procedure, called CalculateTax, back to the calling code?

  1. Return Sales*0.08

  2. CalculateTax = Sales*0.08

  3. Return CalculateTax (Sales*0.08)

  4. Both a and b.

  5. All of the above.

Answer: 4

Which part of a function procedure declaration statement is optional?

  1. Datatype

  2. Function

  3. Parameters

  4. Private

  5. ProcedureName

Answer: 3

How many return statements are allowed in a Function Procedure?

  1. 1

  2. 2

  3. 3

  4. There is no limit.

Answer: 4

Why should a variable not be declared as a module variable?

  1. It prevents a procedure from being self contained.

  2. It makes it easier to document the code.

  3. Local variable names can be reused in other procedures.

  4. Both a and b.

  5. All of the above.

Answer: 5

Which variable name uses a standard naming convention for module variables?

  1. mWeight

  2. mdWeight

  3. moduleWeight

  4. module_Weight

Answer: 1

The scope of a variable refers to:

  1. the length of the variable.

  2. the name of the variable.

  3. the accessibility of the variable.

  4. the datatype of the variable.

  5. the lifetime of the variable.

Answer: 3

What is the value of the index for the first element in a VB.NET array?

  1. 1

  2. 2

  3. 3

  4. Depends on what the assigned value is.

Answer: 4

Which method will return the number of elements in an array?

  1. Dimension

  2. Length

  3. Number

  4. Size

  5. UpperBound

Answer: 2
+ View questions