# Exam coming up, I have questions I need help answering.

4. How to throw an exception.
- Why would you want to throw an exception?

5. How to work with Arrays
-      How to assign values to the elements of an array
- Does this mean when I code:
Dim totals (3) As Decimal
totals (0) = 14.95D
totals (1) = 12.95D....ect
The values are the 0, 1, 2, 3?
Or are the values the 14.95, 12.95....ect?

6. How to use LOOPs to work with array:

I know the code below is putting the numbers 0 through 9 into an array.  But what exactly is this telling me?     Can show an example?
Dim numbers (9) As Integer
For i As Integer = 0 To numbers.Length - 1
numbers (i) = i
Next

7. How to refer to and copy arrays

My professor had this example on his slide.  I dont understand how this works at all!

Code that creates a reference to another array
Dim inches1() As Double = {1, 2, 3}
Dim inches2() As Double = inches1
inches2(2) = ???  ({3})
inches2(1) = 5

then inches1(1) = 5
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Project managerCommented:
4. You can explicitly throw an exception using the throw statement. You can also throw a caught exception again using the throw statement. It is good coding practice to add information to an exception that is rethrown to provide more information when debugging.

The following code example uses a try/catch block to catch a possible FileNotFoundException. Following the try block is a catch block that catches the FileNotFoundException and writes a message to the console if the data file is not found. The next statement is the throw statement that throws a new FileNotFoundException and adds text information to the exception.

Source: http://msdn.microsoft.com/en-us/library/xhcbs8fz(VS.80).aspx

5. Working with arrays: practical example:
http://www.startvbdotnet.com/language/arrays.aspx

6. Looping through arrays.
Example given is a very easy example to show how you can fill an array or to retrieve all the values in an array

7. Copying arrays: Fun with VB.NET Arrays
http://www.knowdotnet.com/articles/arrays.html

Experts Exchange Solution brought to you by