Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Type a single Visual Basic statement that declares myHeight as a real number and

ID: 3780795 • Letter: T

Question

Type a single Visual Basic statement that declares myHeight as a real number and initializes it to 6.15. Note: Letters that are not capitalized properly will count against you (e.g., the following statement is incorrect: dim temp as double). Make sure to only include one space in between each word/letter/symbol.

Type a single Visual Basic statement that declares myWeek as a whole number and initializes it to 3. Note: Letters that are not capitalized properly will count against you (e.g., the following statement is incorrect: dim temp as double). Make sure to only include one space in between each word/letter/symbol.

Type a single Visual Basic statement that declares myWeight as a real number and initializes it to 131.55. Note: Letters that are not capitalized properly will count against you (e.g., the following statement is incorrect: dim temp as double). Make sure to only include one space in between each word/letter/symbol.

Type a single Visual Basic statement that declares variable health as a whole number and initializes it to 100. Note: Letters that are not capitalized properly will count against you (e.g., the following statement is incorrect: dim temp as double). Make sure to only include one space in between each word/letter/symbol.

Which of the following Visual Basic statements declares and initializes variable myPar to 10?

Dim myPar As Integer 10

Dim myPar As Integer = 10

Dim myPar As Integer (10);

none of the above

The following Visual Basic statement declares variable myPar as a real number.

Dim myPar As Double

True

False

The following Visual Basic statement declares variable myNum as a whole number.

Dim myNum As Integer

True

False

The following Visual Basic statement declares variable myData as a whole number.

Dim myData As Double

True

False

Dim myPar As Integer 10

Dim myPar As Integer = 10

Dim myPar As Integer (10);

none of the above

The following Visual Basic statement declares variable myPar as a real number.

Dim myPar As Double

True

False

The following Visual Basic statement declares variable myNum as a whole number.

Dim myNum As Integer

True

False

The following Visual Basic statement declares variable myData as a whole number.

Dim myData As Double

True

False

Explanation / Answer

In Visual Basic the variables are declared using Dim keyword.

Syntax:

Dim variableName As VariableType

1.

Dim myHeight As Double = 6.15

Explanation:

Double (double-precision floating point) allocates 8 bytes of memory for real numbers.

2.

Dim myWeek As Integer = 3

Explanation:

Integers are whole numbers, but they also include negative numbers, but still no fractions allowed.

Therefore, integers can be negative {-1, -2,-3, -4, -5, ... }, positive {1, 2, 3, 4, 5, ... }, or zero {0}

We can put that all together like this:

Integers = { ..., -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, ... }

3.

Dim myWeight As Double = 131.55

Explanation:

Double (double-precision floating point) allocates 8 bytes of memory for real numbers.

4.

Dim health As Integer = 100

Explanation:

Integers are whole numbers, but they also include negative numbers, but still no fractions allowed.

Therefore, integers can be negative {-1, -2,-3, -4, -5, ... }, positive {1, 2, 3, 4, 5, ... }, or zero {0}

We can put that all together like this:

Integers = { ..., -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, ... }

5.

Dim myPar As Integer = 10

Explanation:

Syntax:

Dim variableName As VariableType=value

Hence, the correct option is B.

6.

True

Explanation:

Dim variableName As VariableType

Dim myPar As Double

7.

True

Explanation:

Dim variableName As VariableType

Dim myNum As Integer

8.

False

Explanation:

Dim variableName As VariableType

Dim myData As Double