Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The world population reached 6.83 billion people in January 2010 and was growing

ID: 3657501 • Letter: T

Question

The world population reached 6.83 billion people in January 2010 and was growing at the rate of 1.12% each year. Assuming that the population will continue to grow at yhe same rate, when will the population reach 10 billion? here below is the program that I wrote but it is not working >>>Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click >>>Dim numyears As Integer = 0 >>>Dim currpop As Double = 6.83 >>> Dim growthrate As Double = 1.12 >>> Dim poptenbill As Double = 10 >>> Do While currpop <= poptenbill >>> currpop += currpop * 1.0112 >>>numyears += 1 >>> Loop >>> txtOutput.Text = numyears End Sub

Explanation / Answer

//your program works, though I changed your formula a little to use your variable // you will exceed 10 on 35th year Private Sub btnCalculate_Click(sender As System.Object, e As System.EventArgs) Handles btnCalculate.Click Dim numyears As Integer = 0 Dim currpop As Double = 6.83 Dim growthrate As Double = 1.12 Dim poptenbill As Double = 10 Do While currpop