Tecumseh
Footballguy
Can you tell me why I am stuck in an infinite loop in these two programs?
Program 1- Trying to output the number of years required to double your principle with compound interest:
Program 1- Trying to output the number of years required to double your principle with compound interest:
Code:
Private Sub btnDetermine_Click(sender As Object, e As EventArgs) Handles btnDetermine.Click Dim amount, interest, years, newbalance, total As Double amount = CDbl(txtAmount.Text) interest = CDbl(txtInterest.Text) Do While total <> (2 * amount) newbalance = (amount * interest) total = (newbalance * interest) years += 1 Loop txtYears.Text = CStr(years) End Sub