Question: Question 1 When you declare a variable of type Single, it contains 0 by default. True False Question 2 The following line declares an array

Question 1

When you declare a variable of type Single, it contains 0 by default.

True

False

Question 2

The following line declares an array that can contain whole numbers, with 10 elements.

Dim Variables(9) As Integer

True

False

Question 3

Once a variable is declared we can not change the variable's data type.

True

False

Question 4

If A is False and B is True, then A Or B is True because A is False.

True

False

Question 5

The data type of 25.5 is:

String

All shown answers are correct

Integer

Single

Question 6

The data type of 5 is:

Short

All shown answers are correct

Integer

Long

Question 7

The data type of the Text property is:

No correct answer is shown

Integer

String

Single

Question 8

Which of the following is a Boolean expression:

All answers shown are correct.

A Xor B

X

where X is integer

0

Question 9

To refer to a property xyz of a control named abc in your Visual Basic code, you use:

xyz.abc

a.b.c.x.y.z.

abc.xyz

No correct answer is shown

Question 10

Assume this code:

Dim Nums(Y) As Integer

Assume later we filled the array Nums with integer values.

Write one line of code that calculates the average of: the first and the last element of Nums. Display the average in a messagebox.

Question 11

Assume that an array z, is declared as in:

Dim z(n) As Integer

and that z has been filled with data in all its locations, and n is an odd number.

<-- array content is integer values

0 1 2 3 n <-- index or location

Write code that uses a for loop, to calculate the average of every other number in z starting from location 0 to location n inclusive.

Since n is an odd number the for loop can start at the first location and end at the last location of z.

Think of what the step should be so we process one element then skip the next one and move on to the one after that.

After the loop show the resulting average in a messagebox. Think about the number of elements we need to divide by is half of the elements between locations 0 and n.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!