0

I tried to write this code out, I dont want the answer I just want someone to explain to me what I am missing and doing wrong.

Suppose the population of a certain country was 125,000 at the beginning of the year 1995. The population is growing at a rate of 4.3% per year. Write a program that determines in what year the population will reach or exceed 200,000.


Private Sub btnDisplay_Click(...)Handles_
btnDisplay.Click
Dim number As Integer
Dim count As Integer
number = 125000
count = 12 months
Do
number = number * 4.3
count = count + 1
Loop Until count = 200000
lstOutput.Items.Add(number)
End Sub

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by waynespangler
0

number = number * 4.3

i think that's wrong , you need to add 125,000 to the population grouth each year

number=number+(number*4.3)
Loop Until
count = 200000

other thing why you stop looping untill count=200 000 ?i think you mean number not count

Edited by diafol: fixed formatting

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.