VB.Net Practice Exam: Quiz!

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Tcarteronw
T
Tcarteronw
Community Contributor
Quizzes Created: 37 | Total Attempts: 31,078
Questions: 56 | Attempts: 2,651

SettingsSettingsSettings
VB.Net Practice Exam: Quiz! - Quiz

.


Questions and Answers
  • 1. 

    If a project runs without a syntax error, you can be certain that the code has performed the project's task correctly.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Page: 43 Objective: 9

    Rate this question:

  • 2. 

    If the programmer does not write code for a button control, Visual Basic automatically provides code in the Click procedure that will close the form when the user clicks the button.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Page: 28 Objective: 8

    Rate this question:

  • 3. 

    After you have added a label to a form you can change the words that are displayed inside the button by changing the Text property.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Page: 24 Objective: 8

    Rate this question:

  • 4. 

    You write Visual Basic code statements during design time.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Page: 13 Objective: 7

    Rate this question:

  • 5. 

    You can use the Properties window to change the properties of controls during run time.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Page: 12 Objective: 7

    Rate this question:

  • 6. 

    You are in run time when you design the user interface.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Page: 13 Objective: 7

    Rate this question:

  • 7. 

    The Solution Explorer window is where you design a form that makes up your user interface.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Page: 12 Objective: 6

    Rate this question:

  • 8. 

    The Properties window is used to set the properties for the objects on your form.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Page: 12 Objective: 6

    Rate this question:

  • 9. 

    The .resx file is a text file that defines all resources used by the form including any graphics that are displayed on the form.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Page: 7 Objective: 5

    Rate this question:

  • 10. 

    When creating a project in Visual Basic you should always begin by writing the Basic code.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Page: 6 Objective: 4

    Rate this question:

  • 11. 

    A .vb file holds the definition of a form, its controls, and code procedures.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Page: 7 Objective: 5

    Rate this question:

  • 12. 

    Writing a program in Visual Basic is so easy that it is not necessary to do any planning.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Page: 6 Objective: 4

    Rate this question:

  • 13. 

    With Visual Basic you can write computer programs that run in the Microsoft Windows environment.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Page: 2 Objective: 1

    Rate this question:

  • 14. 

    Visual Basic.NET is an object-oriented programming language.  

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Page: 3 Objective: 2

    Rate this question:

  • 15. 

    In Form1.Text, the word Text is referring to a method.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Page: 4 Objective: 3

    Rate this question:

  • 16. 

    The ______ symbol is used for concatenation.

    • A.

      & (ampersand)

    • B.

      @ (at)

    • C.

      ' (apostrophe)

    • D.

      _ (underscore)

    Correct Answer
    A. & (ampersand)
    Explanation
    Page: 80 Objective: 8

    Rate this question:

  • 17. 

    If you would like to change the background color on a form, you must change the form's _____________ property.

    • A.

      ForeColor

    • B.

      BackColor

    • C.

      Appearance

    • D.

      Background

    Correct Answer
    B. BackColor
    Explanation
    Page: 79 Objective: 6

    Rate this question:

  • 18. 

    As a program runs, the insertion point can be moved from control to control.  In order to reset the focus back in a text box named nameTextBox you should use the code _______.

    • A.

      TxtName.Focus()

    • B.

      TxtName = Focus()

    • C.

      TxtName = Top()

    • D.

      TxtName.First()

    Correct Answer
    A. TxtName.Focus()
    Explanation
    Page: 79 Objective: 4

    Rate this question:

  • 19. 

    Which of the following statements will clear the contents of a text box named messageTextBox?

    • A.

      TxtMessage.Text = ""

    • B.

      TxtMessage.Clear()

    • C.

      TxtMessage.Text = String.Empty

    • D.

      All of the answers are correct

    Correct Answer
    D. All of the answers are correct
    Explanation
    Page: 78 Objective: 5

    Rate this question:

  • 20. 

    Setting the TabIndex of a control to 0 (zero) will _______.

    • A.

      Cause the control to appear to the right of the other controls

    • B.

      Make the control Visible

    • C.

      Align the control to the left of the other controls

    • D.

      Set the focus on this control when the program begins running

    Correct Answer
    D. Set the focus on this control when the program begins running
    Explanation
    Page: 73 Objective: 4

    Rate this question:

  • 21. 

    Create keyboard access on an object by ______________ in the Text property.

    • A.

      Using ampersand (&)

    • B.

      Using at (@)

    • C.

      Using underscore ( _)

    • D.

      Capitalizing the first letter of the word

    Correct Answer
    A. Using ampersand (&)
    Explanation
    Page: 72 Objective: 4

    Rate this question:

  • 22. 

    You can vertically align a group of controls on your form by first selecting all of the controls to be aligned, and then _______.

    • A.

      Setting their X property to the same value

    • B.

      Selecting Align from the Format menu and then choosing Lefts.

    • C.

      Selecting "Make Same Size" from the Layout toolbar

    • D.

      Setting their Height property to the same value

    Correct Answer
    D. Setting their Height property to the same value
    Explanation
    Page: 70 Objective: 3

    Rate this question:

  • 23. 

    The property used to display information in a TextBox is _______.

    • A.

      Caption

    • B.

      Name

    • C.

      Text

    • D.

      Appearance

    Correct Answer
    C. Text
    Explanation
    Page: 63 Objective: 1

    Rate this question:

  • 24. 

    Which of the following is not an object?

    • A.

      Form

    • B.

      GroupBox

    • C.

      RadioButton

    • D.

      All of the above are objects

    Correct Answer
    D. All of the above are objects
    Explanation
    Page: 62 Objective: 1

    Rate this question:

  • 25. 

    You can break a long line of code into multiple lines by ________ and then continuing writing code on the next line.

    • A.

      Pressing the Enter key at the end of the line

    • B.

      Adding a blank space and a plus sign ( + ) at the end of the line

    • C.

      Adding a blank space and an ampersand ( & ) at the end of the line

    • D.

      Adding a blank space and an underscore ( _ ) at the end of the line

    Correct Answer
    D. Adding a blank space and an underscore ( _ ) at the end of the line
    Explanation
    Page: 81 Objective: 8

    Rate this question:

  • 26. 

    When you declare a variable or a named constant, Visual Basic reserves an area of memory and assigns it a name called a(n) _______.

    • A.

      Identifier

    • B.

      Identity

    • C.

      Declaration

    • D.

      Dimension

    Correct Answer
    A. Identifier
    Explanation
    Answer: A Page: 97 Objective: 1

    Rate this question:

  • 27. 

    Declaration statements _______.

    • A.

      Are only used for variables and are not needed for constants

    • B.

      Are only allowed in the Declarations section of a form

    • C.

      Give variables and constants names, and specify the type of data they will hold

    • D.

      Both answers B and C are correct.

    Correct Answer
    C. Give variables and constants names, and specify the type of data they will hold
    Explanation
    Answer: C Page: 97 Objective: 1

    Rate this question:

  • 28. 

    Which of the following is not a valid data type?

    • A.

      Integer

    • B.

      Real

    • C.

      Decimal

    • D.

      String

    Correct Answer
    B. Real
    Explanation
    Answer: B Page: 97 Objective: 2

    Rate this question:

  • 29. 

    The data type that is used for decimal fractions is _______.

    • A.

      Decimal

    • B.

      Short

    • C.

      Integer

    • D.

      Fraction

    Correct Answer
    A. Decimal
    Explanation
    Answer: A Page: 97 Objective: 2

    Rate this question:

  • 30. 

    Which of the following is not a valid rule for naming identifiers?

    • A.

      Names may contain underscores, but not good coding standards

    • B.

      Names may contain letters

    • C.

      Names may contain digits

    • D.

      Names may contain spaces

    Correct Answer
    D. Names may contain spaces
    Explanation
    Answer: D Page: 98 Objective: 3

    Rate this question:

  • 31. 

    Which of the following is NOT a rule for naming identifiers?

    • A.

      Identifiers for constants should use an underscore between words

    • B.

      Identifiers should use periods to separate words

    • C.

      Identifiers should list the data type at the end of the name

    • D.

      Identifiers cannot contain embedded blanks

    Correct Answer
    B. Identifiers should use periods to separate words
    Explanation
    Answer: B Page: 98 Objective: 3

    Rate this question:

  • 32. 

    The length of identifiers is limited to _______.

    • A.

      1 to 8 characters

    • B.

      1 to 256 characters

    • C.

      1 to 4,000 characters

    • D.

      1 to 16,383 characters

    Correct Answer
    D. 1 to 16,383 characters
    Explanation
    Answer: D Page: 98 Objective: 3

    Rate this question:

  • 33. 

    Which of the following does not follow the conventions for naming identifiers?

    • A.

      DecUnitsEnrolled

    • B.

      StrZipCode

    • C.

      Dec.amount.due

    • D.

      STRCOUNTRY

    Correct Answer
    C. Dec.amount.due
    Explanation
    Answer: C Page: 98 Objective: 3

    Rate this question:

  • 34. 

    Which of the following is not a rule for naming identifiers for constants?

    • A.

      Include the data type at the end of the identifier

    • B.

      Everything in the identifier's name should be capitalized except the data type

    • C.

      Identifiers for constants should begin with a prefix of Const

    • D.

      Identifiers for constants should use an underscore between words

    Correct Answer
    C. Identifiers for constants should begin with a prefix of Const
    Explanation
    Answer: C Page: 99 Objective: 3

    Rate this question:

  • 35. 

    Intrinsic constants are _______.

    • A.

      Declared using the keyword Const

    • B.

      Declared using the keyword Dim

    • C.

      Placed in the Declarations section of a form

    • D.

      Built into Visual Studio

    Correct Answer
    D. Built into Visual Studio
    Explanation
    Answer: D Page: 101 Objective: 4

    Rate this question:

  • 36. 

    If Option Strict is turned off and a declaration statement does not specify a data type, it will default to _______.

    • A.

      Boolean

    • B.

      String

    • C.

      Object

    • D.

      Variable

    Correct Answer
    C. Object
    Explanation
    Answer: C Page: 101 Objective: 4

    Rate this question:

  • 37. 

    The reserved Visual Basic word, Dim, is short for dimension, which means _______.

    • A.

      Declaration

    • B.

      Size

    • C.

      Storage location

    • D.

      Identifier

    Correct Answer
    B. Size
    Explanation
    Answer: B Page: 102 Objective: 4

    Rate this question:

  • 38. 

    Which of the following is a valid statement that can be used to declare a local variable that will store whole numbers?

    • A.

      Dim indexWhole as Whole

    • B.

      Dim strIndex as String

    • C.

      Dim Integer as Index

    • D.

      Dim intIndex as Integer

    Correct Answer
    D. Dim intIndex as Integer
    Explanation
    Answer: D Page: 102 Objective: 4

    Rate this question:

  • 39. 

    Which of the following is a valid statement that can be used to declare a local variable that will store fractions?

    • A.

      Dim indexFraction As Fraction

    • B.

      Dim strIndex As String

    • C.

      Dim decIndex As Decimal

    • D.

      Dim intIndex As Integer

    Correct Answer
    C. Dim decIndex As Decimal
    Explanation
    Answer: C Page: 102 Objective: 4

    Rate this question:

  • 40. 

    Where should the statement: Dim counterInteger As Integer, appear if you plan to use counterInteger in only one event procedure?

    • A.

      The Declarations section of the form

    • B.

      The Form_Load procedure

    • C.

      The event procedure where intCounter will be used

    • D.

      The Namespace Constants file

    Correct Answer
    C. The event procedure where intCounter will be used
    Explanation
    Answer: C Page: 103 Objective: 5

    Rate this question:

  • 41. 

    Where should the statement: Const STR_ACCOUNT_NUMBER As String = "A45", appear if you plan to use STR_ACCOUNT_NUMBER in more than one procedure?

    • A.

      The Declarations section of the form

    • B.

      The Form_Load procedure

    • C.

      The event procedure where STR_ACCOUNT_NUMBER will be used

    • D.

      The Namespace Constants file

    Correct Answer
    A. The Declarations section of the form
    Explanation
    Answer: A Page: 104 Objective: 5

    Rate this question:

  • 42. 

    A _______ variable is declared inside a procedure.

    • A.

      Namespace

    • B.

      Module-level

    • C.

      Local

    • D.

      Block

    Correct Answer
    C. Local
    Explanation
    Answer: C Page: 104 Objective: 5

    Rate this question:

  • 43. 

    Variables declared within a button's click-event are _____ variables.

    • A.

      Local

    • B.

      Module-level

    • C.

      Namespace

    • D.

      Private

    Correct Answer
    A. Local
    Explanation
    Answer: A Page: 104 Objective: 5

    Rate this question:

  • 44. 

    If a procedure contains a Dim statement and strName is assigned as the identifier, strName can be used _______.

    • A.

      Anywhere in the project

    • B.

      Only in the procedure where the Dim statement is shown

    • C.

      Anywhere in the project if the variable name is changed to STR_NAME

    • D.

      Only once in the procedure

    Correct Answer
    B. Only in the procedure where the Dim statement is shown
    Explanation
    Answer: B Page: 104 Objective: 5

    Rate this question:

  • 45. 

    A variable that is declared in the Declarations section of a form is a(n) _______.

    • A.

      Module-level variable

    • B.

      Local variable

    • C.

      Block variable

    • D.

      General variable

    Correct Answer
    A. Module-level variable
    Explanation
    Answer: A Page: 104 Objective: 5

    Rate this question:

  • 46. 

    What statement should be used to declare a module-level variable?

    • A.

      Dim

    • B.

      Const

    • C.

      Private

    • D.

      Public

    Correct Answer
    C. Private
    Explanation
    Answer: C Page: 104 Objective: 5

    Rate this question:

  • 47. 

    Integer.Parse is used to _______.

    • A.

      Convert data in a textbox to a numeric value with no decimal places

    • B.

      Properly align decimal positions in a numeric value

    • C.

      Add a dollar sign ($) to improve the way the output looks

    • D.

      Convert data in a textbox to a numeric value with 2 decimal places

    Correct Answer
    A. Convert data in a textbox to a numeric value with no decimal places
    Explanation
    Answer: A Page: 106 Objective: 6

    Rate this question:

  • 48. 

    Which of the following is not a valid method for parsing?

    • A.

      Integer.Parse

    • B.

      Decimal.Parse

    • C.

      Parse.String

    • D.

      All of the above are valid

    Correct Answer
    C. Parse.String
    Explanation
    Answer: C Page: 107 Objective: 6

    Rate this question:

  • 49. 

    Which of the following has the highest order of precedence in arithmetic expressions?

    • A.

      Multiplication and division

    • B.

      Addition and subtraction

    • C.

      Exponentiation

    • D.

      Operators are not significant; all calculations are evaluated from left to right

    Correct Answer
    C. Exponentiation
    Explanation
    Answer: C Page: 109 Objective: 7

    Rate this question:

  • 50. 

    What will be the value of answerInteger after execution of these statements?             Const numberAInteger as Integer = 6             Const numberBInteger as Integer = Const numberCInteger as Integer = 2             answerInteger = numberAInteger + numberBInteger * numberCInteger  

    • A.

      6

    • B.

      14

    • C.

      20

    • D.

      48

    Correct Answer
    B. 14
    Explanation
    Answer: B Page: 109 Objective: 7

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • May 11, 2011
    Quiz Created by
    Tcarteronw
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.