Hi all, I'm still a newbie to programming and in school we are working with arrays.
We received a program that needs to have modifications done to it and I don't understand why the "89000" amount is outside the array bounds. It is a console app. that calculates amortization.
How can I change the bounds of the array? Thanks!Code:Sub Main() 'Testing Start When testing comment the line below and ' uncomment Dim s(3) below Dim s() As String = System.Environment.GetCommandLineArgs() 'Dim s(3) As String 'Testing End - Dim dblLoanAmount As Double Dim intYears As Integer Dim dblInterestRate As Double 'Testing Start - When testing uncomment the 3 lines below s(1) = "89000" s(2) = "30" s(3) = ".04" 'Testing End - If s.Length = 4 Then If ValidateParms(s(1), s(2), s(3)) = True Then 'Continue processing Amort Schedule 'Explicitly Convert inputs to numerics to be passed ' to AmortSched below 'YOUR CODE HERE AmortSched(dblLoanAmount, intYears, dblInterestRate) Else Console.WriteLine("Parameters not valid") Console.WriteLine("Amount " & s(1)) Console.WriteLine("Periods " & s(2)) Console.WriteLine("Annual Rate " & s(3)) End If Else Console.WriteLine("Missing parameters") End If 'Keep command line window open until user presses ENTER Console.ReadLine() End Sub
-radioactivedrummer




Reply With Quote
