Selecting Data Type and Name for the Variable - Visual Basic Questions and Answers

DigitalOcean Referral Badge DigitalOcean Referral Badge

1.

__________ is used to store temporary data by programmers.

   A.) Addressed Location
   B.) Variable
   C.) Pointer
   D.) RAM

Answer: Option 'B'

Variable

The name variable is used because their values change throughout the lifetime of the application. Thus the variable is also stored temporary data by programmers. Variable can be of any data type such as integer, character etc. For example, int a=0, is of datatype integer, where ‘a’ is a variable used to store an integer value.

DigitalOcean Referral Badge

2.

___________ determines the type of data stored in a variable.

   A.) Function type
   B.) Data Type
   C.) Variable type
   D.) Info Type

Answer: Option 'B'

Data Type

Data type determines the type of data stored in a variable. Each Data type is a class. Each instance of these classes has a certain pattern of data. The variables are the instances of the class data type.

DigitalOcean Referral Badge

3.

___________ is the universal coding scheme for characters.

   A.) EBCDIC
   B.) Binary
   C.) ASCII
   D.) Unicode

Answer: Option 'D'

Unicode

Unicode is the universal coding scheme for characters. Unicode can be implemented by different character encodings in different systems. The most commonly used encodings are UTF-8, UTF-16 and the now-obsolete UCS-2.

DigitalOcean Referral Badge

4.

”dblMy Age “what is the problem with this variable name?

   A.) Starts with uppercase character
   B.) Contains uppercase characters
   C.) Contains a space
   D.) Contains reserved word dbl

Answer: Option 'C'

Contains a space

Variable names must begin with a letter or an underscore. They can only contain numbers characters and underscores. No punctuation, special characters or spaces are allowed.

DigitalOcean Referral Badge
    DigitalOcean Referral Badge DigitalOcean Referral Badge

5.

Declaring a variable tell the computer to allocate a memory space that can be accessed by the variable name. The size of the memory space depends on?

   A.) Size of memory in computer
   B.) Location of variable in program
   C.) Data type of the variable
   D.) Length of variable name

Answer: Option 'C'

Data type of the variable

Based on the data type of a variable, the operating system allocates memory and decides what can be stored in the allocated memory. Each data type allocates different size of allocated memory.

DigitalOcean Referral Badge

6.

___________ data type can store any type of data.

   A.) Object
   B.) Common
   C.) DataType
   D.) Universal

Answer: Option 'A'

Object
Object class is the parent class of all Primitive data types. Hence it can contain any type of data. However extra work is needed to determine the type of data. An object is an instance of the class. Thus creating data type for a class is an object data type.

DigitalOcean Referral Badge

7.

String data type can store from zero to ___________ Unicode characters.

   A.) 2 million
   B.) 2 billion
   C.) 1 million
   D.) 1 billion

Answer: Option 'B'

2 billion

String is used to store text and can store up to 2 billion characters in Unicode. A string is generally understood as a data type and is often implemented as an array of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. A string may also denote more general arrays or other sequence (or list) data types and structures.

DigitalOcean Referral Badge

8.

The range of Integer data type is ___________ to ___________

   A.) –2,147,483,648 to 2,147,483,647
   B.) –32,768 to 32,767
   C.) –9,223,372,036,854,775,808 to9,223,372,036,854,775,807
   D.) +/–4.94065645841247 X 10–324 to+/–1.79769313486231 X 10308

Answer: Option 'A'

–2,147,483,648 to 2,147,483,647

The Integer data type ranges from –2,147,483,648 to 2,147,483,647 whereas the Short integer is of 2 bytes and ranges from –32,768 to 32,767 and long integer is of 8 bytes and ranges from –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

DigitalOcean Referral Badge

9.

The Char data type can store ___________

   A.) One Unicode character
   B.) One bit
   C.) One Byte
   D.) One ASCII character

Answer: Option 'A'

One Unicode character

The Char data type is of 2 Bytes and can store one Unicode character. It holds unsigned 16-bit (2-byte) code points ranging in value from 0 through 65535. Each code point, or character code, represents a single Unicode character.

DigitalOcean Referral Badge
    DigitalOcean Referral Badge DigitalOcean Referral Badge

10.

The variable name is also termed as ___________

   A.) Vname
   B.) Alterable
   C.) Identifier
   D.) Uniform

Answer: Option 'C'

The variable name is also called an identifier. An identifier is a name that identifies (that is, labels the identity of) either a unique object or a unique class of objects, where the “object” or class may be an idea, physical [countable] object (or class thereof), or physical [noncountable] substance (or class thereof). The abbreviation ID often refers to identity, identification (the process of identifying), or an identifier (that is, an instance of identification). An identifier may be a word, number, letter, symbol, or any combination of those.

DigitalOcean Referral Badge

Selecting Data Type and Name for the Variable - Visual Basic Questions and Answers Download Pdf

Recent Posts