Hello in this code i'm like counting the interest of the start capital and doing this untill the start capital is as much worth as its double but now beside of that i'd like to count with a for next the years so like

start capital 100
interest 5

year 1 : 105
year 2 : (105 + 105*interest/100)

Dim intinterest As Integer
Dim snggoal, sngtotaal, sngcapital As Single

sngcapital = Integer.Parse(txtkapitaal.Text)
intinterest = Integer.Parse(txtrente.Text)
snggoal = sngcapital * 2
sngtotaal = sngcapital + sngcapital * intinterest / 100

Do Until sngcapital >= snggoal

    sngtotaal = Math.Round((sngcapital + sngcapital * intinterest / 100), 2)
    lstkapitaal.Items.Add(sngtotaal)
    sngcapital = sngtotaal

Loop

You just need a new var to hold the number of years and increment that by 1 before your Loop

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.