Question: 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 thatcalculates

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 thatcalculates 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

andthat zhas been filled with data in all its locations, and n is an odd number.

<-- array content is integer values

0123 n <--index or location

Write code that uses aforloop, to calculate the average of everyother numberin z starting from location 0 to location ninclusive.

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 averagein 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!