Module Module1 Public Class Tester Public Sub Run() Try Dim a As Double Dim b As Double System.Console.WriteLine("Please Enter A Number: ") a = Double.Parse(Console.ReadLine()) System.Console.WriteLine("Please Enter Another Number: ") b = Double.Parse(Console.ReadLine()) Console.WriteLine("Dividing {0} by {1}...", a, b) Console.WriteLine("{0} / {1} = {2}", a, b, DoDivide(a, b)) 'Most derived exception type first Catch e As System.DivideByZeroException Console.WriteLine(vbCrLf + "DivideByZeroException! Msg: {0}", e.Message) Catch e As System.ArithmeticException Console.WriteLine(vbCrLf + "ArithmeticException! Msg: {0}", e.Message) 'Generic exception type last Catch Console.WriteLine("Unknown exception caught") Finally Console.WriteLine("Close file here.") End Try End Sub 'Do the division if legal Public Function DoDivide(ByVal a As Double, ByVal b As Double) As Double If (b = 0) Then Throw New System.DivideByZeroException() End If If (a = 0) Then Throw New System.ArithmeticException() End If Return a / b End Function End Class Sub Main() Console.WriteLine("Enter Main...") Dim t As Tester = New Tester() t.Run() Console.WriteLine("Exit Main...") Console.ReadLine() End Sub End Module