Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago