Computer Visual Basic Quiz

31 Questions | Attempts: 1783
Share

SettingsSettingsSettings
Computer Visual Basic Quiz - Quiz

Computer Visual Basic is a programming language that provides Graphical User Interface. This computer Visual Basic quiz will test your knowledge of the subject and will also provide valuable insight into the matter. The quiz contains various facts, trivia, and other relevant questions from the stream to help you master the topic. Knowing computer Visual Basic would greatly help accelerate your career growth. So try this informative quiz. All the best!


Questions and Answers
  • 1. 
    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

  • 2. 
    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.

  • 3. 
    Which of the following is not a valid data type?
    • A. 

      Integer

    • B. 

      Real

    • C. 

      Decimal

    • D. 

      String

  • 4. 
    The data type that is used for decimal fractions is _______.
    • A. 

      Decimal

    • B. 

      Short

    • C. 

      Integer

    • D. 

      Fraction

  • 5. 
    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

  • 6. 
    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

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

  • 8. 
    Which of the following does not follow the conventions for naming identifiers?
    • A. 

      DecUnitsEnrolled

    • B. 

      StrZipCode

    • C. 

      Dec.amount.due

    • D. 

      STRCOUNTRY

  • 9. 
    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

  • 10. 
    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

  • 11. 
    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

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

      Declaration

    • B. 

      Size

    • C. 

      Storage location

    • D. 

      Identifier

  • 13. 
    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

  • 14. 
    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

  • 15. 
    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

  • 16. 
    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

  • 17. 
    A _______ variable is declared inside a procedure.
    • A. 

      Namespace

    • B. 

      Module-level

    • C. 

      Local

    • D. 

      Block

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

      Local

    • B. 

      Module-level

    • C. 

      Namespace

    • D. 

      Private

  • 19. 
    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

  • 20. 
    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

  • 21. 
    What statement should be used to declare a module-level variable?
    • A. 

      Dim

    • B. 

      Const

    • C. 

      Private

    • D. 

      Public

  • 22. 
    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

  • 23. 
    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

  • 24. 
    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

  • 25. 
    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

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.