Computer Visual Basic 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: 31 | Attempts: 1,958

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

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

    Rate this question:

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

    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:

  • 3. 

    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:

  • 4. 

    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:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 8. 

    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:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 12. 

    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:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 17. 

    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:

  • 18. 

    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:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 21. 

    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:

  • 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

    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:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 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

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

    Rate this question:

  • 26. 

    Using the order of precedence and the formula below, what is answerInteger if:             numberOneInteger=2, numberTwoInteger=12, numberThreeInteger=20, and numberFourInteger=6             answerInteger= numberOneInteger * (numberTwoInteger + numberThreeInteger) - numberFourInteger / numberOneInteger

    • A.

      19

    • B.

      41

    • C.

      61

    • D.

      None of the above

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

    Rate this question:

  • 27. 

    What will be the value of totalInteger after execution of this statement?             Assume that valueInteger = 2.             totalInteger= ((valueInteger + 2) * (valueInteger + 4)) / valueInteger + 1

    • A.

      13

    • B.

      8

    • C.

      12

    • D.

      None of the above

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

    Rate this question:

  • 28. 

    What will be the value of answerInteger after execution of the following line of code?             Assume that numberAInteger = 6, numberBInteger = 4, numberCInteger = 2             answerInteger = (numberAInteger + numberBInteger) * (numberAInteger / numberCInteger)

    • A.

      6

    • B.

      30

    • C.

      27

    • D.

      None of the above

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

    Rate this question:

  • 29. 

    The Visual Basic statement that requires all variables to be declared is _______.

    • A.

      Dim

    • B.

      Option Strict On

    • C.

      Option Explicit

    • D.

      Declarations

    Correct Answer
    C. Option Explicit
    Explanation
    Answer: C Page: 112 Objective: 8

    Rate this question:

  • 30. 

    In order to control the number of decimals that will appear when a number is displayed, you can use _______.

    • A.

      A conversion function

    • B.

      A string variable

    • C.

      A constant

    • D.

      The format specifier codes

    Correct Answer
    D. The format specifier codes
    Explanation
    Answer: D Page: 116 Objective: 10

    Rate this question:

  • 31. 

    MessageBox.Show("Hello","Goodbye") will display _______.

    • A.

      "Hello" in the message box titlebar and "Goodbye" in the body of the message box

    • B.

      "Goodbye" in the body of the message box; "Hello" is the name of the message box

    • C.

      "Goodbye" in the message box titlebar and "Hello" in the body of the message box

    • D.

      None of the above

    Correct Answer
    C. "Goodbye" in the message box titlebar and "Hello" in the body of the message box
    Explanation
    Answer: C Page: 126 Objective: 12

    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
  • Aug 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • May 11, 2011
    Quiz Created by
    Tcarteronw
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.