hey I am taking a programming and logic class and got a little assignment that im having trouble with. im sure the solution will be easy but at the moment i cant figure it out.
[FONT="]3. Consider a bank account with a Deposit of $ 1000.00 upon opening and another deposit of a 1000.00 at the end of every year.
The Interest rate is a 5 %. Use a Do while statement to calculate how long would take you to save a 1000.000.00[/FONT]
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Balance, Deposit, intrest As Decimal
Dim years, numyears As Integer
Balance = 1000.0
Deposit = 1000.0
intrest = 0.05
years = 0
Do While Balance < 1000000.0
Balance = ((deposit + balance) *.05) + balance) then
numyears = years + 1
MsgBox("It will take " & numyears & " years to become a millionare")
Loop
End Sub
End Class
thats the code i have right now and am having trouble. maybe im taking the wrong approach but i cant figure it out. I dont want the answer, or the code that makes it work, could someone just give me some hints/ideas on what to try to change, or like a different way to approach the problem. thanks
[FONT="]3. Consider a bank account with a Deposit of $ 1000.00 upon opening and another deposit of a 1000.00 at the end of every year.
The Interest rate is a 5 %. Use a Do while statement to calculate how long would take you to save a 1000.000.00[/FONT]
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Balance, Deposit, intrest As Decimal
Dim years, numyears As Integer
Balance = 1000.0
Deposit = 1000.0
intrest = 0.05
years = 0
Do While Balance < 1000000.0
Balance = ((deposit + balance) *.05) + balance) then
numyears = years + 1
MsgBox("It will take " & numyears & " years to become a millionare")
Loop
End Sub
End Class
thats the code i have right now and am having trouble. maybe im taking the wrong approach but i cant figure it out. I dont want the answer, or the code that makes it work, could someone just give me some hints/ideas on what to try to change, or like a different way to approach the problem. thanks