Option Strict On Option Explicit On Public Class frmMain 'Warning! This program does not validate the user's input in any way. Try to fix this yourself! Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click Dim balance As Double, interestRate As Double, numYears As Integer = 0 balance = CDbl(txtAmount.Text) interestRate = CDbl(txtInterestRate.Text) 'loops while the balance is still less than a million dollars Do While balance < 1000000 'calculates new balance after a year balance += interestRate * balance 'counts another year numYears += 1 Loop 'prints out the number of years txtYears.Text = "In " & numYears & " years you will have a million dollars" End Sub End Class