Help! I'm not sure how to start or how calculate. This is the project. Using For Next Loops.

- When $1000 is deposited at 5 percent simple interest, the amount grows by $50 each year. When money is invented at 5 percent compound interest, then the amount at the end of each year is 1.05 times the amount at the beginning of that year. Write a program to display the amounts for 10 years for a $1000 deposit at 5 percent simple and compound interest. The first few lines displayed in the list box should appear as in Figure 6.8

--------------------------------------
Amount Amount
Simple Compound
Year Interest Interest
1 $1,050.00 $1,050.00
2 $1,100.00 $1,102.50
3 $1,150.00 $1,157.63

Figure 6.8 Growth of $1000 at simple and compound interest.
---------------------------------------

You will need to declare two decimal variables, AmountSimple, and AmountCompound.

They should be initialized to 1000 as a start.
Write a for-loop that goes over 10 times (years) and accumulate $50 each year for the simple interest case. For the compound interest, multiply the previous amount by 1.05, or AmountCompound=AmountCompound*1.05

Output (inside the loop) the values of AmountSimple and AmountCompound, taking care to limit the number of digits after the decimal point to 2, with rounding.

Create and run your program. Post the code if you have difficulties.

Okay this is my Code: My coding is quite a bit off. Help me please. Thanks.

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim AmountCompound As Integer = 1000
For AmountSimple As Integer = 1 To 10
AmountSimple = 1000
AmountSimple += 50

If AmountCompound = 1000 Then
AmountCompound = AmountCompound * 1.05
End If
lstOutput.Items.Add(AmountSimple & " Amount Simple Interest" & " ")
lstOutput.Items.Add(AmountCompound & " Amount Compound Interestt" & " ")

Next

End Sub
End Class

The program almost works! Just missing a few little details.

0. As suggested, you will need to define AmountSimple and AmountCompound as Decimal. As it is (Integer), you will be able to display to the dollar, no cents.

1. The For variable should not be AmountSimple. Call it Year and declare it before the for statement.
You'll need it for output.

2. "If AmountCompound = 1000 Then... "
The if condition is not needed, it should be multiplied in all 10 cases.

3. The output with a lot of text is hard to read. For 10 years, it is better to make it in table form.
To make the table correctly, you will need some form of format control to display 2 digits after the decimal point. Otherwise it will look like this:

Year Simple Compound
1 1050 1050
2 1100 1102.5
3 1150 1157.625
4 1200 1215.50625
...

Keep up the good work.

Thank you MathMate. You were a great help. I was able to finish creating the program and it works correctly..

Here is what I got to work but I used 2 separate lists

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim num As Double = 1
Dim Init_Inv As Integer = 1000
Do Until num = 10
Init_Inv = Init_Inv * 1.05
Compound.Items.Add("Year " & num & " | " & FormatCurrency(Init_Inv))
Simple.Items.Add("Year " & num & " | " & FormatCurrency((num * 50) + 1000))
num += 1
Loop

End Sub

Public Class Form1

Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
Dim Compound As Double = 5000
Dim Simple As Double = 5000
Dim i As Integer = 400

lstOutput.Items.Add(vbTab & "Amount" & vbTab & vbTab & "Amount")
lstOutput.Items.Add("Year" & vbTab & "Simple Interest" & vbTab & "Compound Interest")
lstOutput.Items.Add(1 & vbTab & Simple + i & vbTab & vbTab & Compound + (Compound * 0.08))
lstOutput.Items.Add(2 & vbTab & Simple + (i * 2) & vbTab & vbTab & Compound + (Compound * 0.08) * 2)
lstOutput.Items.Add(3 & vbTab & Simple + (i * 3) & vbTab & vbTab & (Compound) + (Compound * 0.08) * 3)
lstOutput.Items.Add(4 & vbTab & Simple + (i * 4) & vbTab & vbTab & Compound + (Compound * 0.08) * 4)
lstOutput.Items.Add(5 & vbTab & Simple + (i * 5) & vbTab & vbTab & Compound + (Compound * 0.08) * 5)
lstOutput.Items.Add(6 & vbTab & Simple + (i * 6) & vbTab & vbTab & Compound + (Compound * 0.08) * 6)
lstOutput.Items.Add(7 & vbTab & Simple + (i * 7) & vbTab & vbTab & Compound + (Compound * 0.08) * 7)
lstOutput.Items.Add(8 & vbTab & Simple + (i * 8) & vbTab & vbTab & (Compound) + (Compound * 0.08) * 8)
lstOutput.Items.Add(9 & vbTab & Simple + (i * 9) & vbTab & vbTab & Compound + (Compound * 0.08) * 9)
lstOutput.Items.Add(10 & vbTab & Simple + (i * 10) & vbTab & vbTab & Compound + (Compound * 0.08) * 10)

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class

To solve this problem, we can use a For Next loop in a program that calculates and displays the amounts for 10 years for a $1000 deposit at 5 percent simple and compound interest. Here's how you can do it:

1. Initialize the variables for the initial deposit amount ($1000), interest rate (5%), and the number of years (10).
2. Create a For Next loop that iterates from 1 to the number of years.
3. Inside the loop, calculate the amount for each year using the simple interest formula and the compound interest formula.
- For simple interest, the formula is: amount = initial deposit + (initial deposit * interest rate)
- For compound interest, the formula is: amount = initial deposit * (1 + interest rate)^year
4. Display the year, amount with simple interest, and amount with compound interest on each iteration.

Here's an example code snippet in Visual Basic:

```vb
' Initialize variables
Dim initialDeposit As Double = 1000
Dim interestRate As Double = 0.05
Dim numYears As Integer = 10
Dim amountSimple As Double
Dim amountCompound As Double

' Display table headers
Console.WriteLine("Year Amount Amount")
Console.WriteLine(" Simple Compound")
Console.WriteLine("-----------------------------")

' Calculate and display amounts for each year
For year As Integer = 1 To numYears
' Calculate amount with simple interest
amountSimple = initialDeposit + (initialDeposit * interestRate * year)

' Calculate amount with compound interest
amountCompound = initialDeposit * (1 + interestRate) ^ year

' Display year and amounts
Console.WriteLine("{0,-7}{1,12:C}{2,12:C}", year, amountSimple, amountCompound)
Next
```

This code will loop through the years from 1 to 10 and calculate the amount for each year using both simple and compound interest formulas. The amounts will be displayed in the console with the corresponding year.

Feel free to modify the code based on your programming language or the platform you are using.