For Section 6.1 Exercuse 32 This is the code I wrote, but when I run the program
ID: 3881623 • Letter: F
Question
For Section 6.1 Exercuse 32 This is the code I wrote, but when I run the program nothing happens. Can someone verify where I've made a mistake please.
Private Sub btnPopulationGrowth_TextChanged(sender As Object, e As EventArgs) Handles btnPopulationGrowth.TextChanged
Dim year As Integer = 2011
Dim population As Double = 7.0
Do While population <= 8
population = population +
population * (1.10 / 100)
year = year() + 1
Loop
txtPopulationGrowth.Text = "World Population" & "will groth to 8 Billion in" & year.ToString() & "."
End Sub
End Class
Explanation / Answer
Private Sub btnPopulationGrowth_TextChanged(sender As Object, e As EventArgs) Handles btnPopulationGrowth.TextChanged
Dim year As Integer = 2011
Dim population As Double = 7.0
Do While population <= 8
population = population +
population * (1.10 / 100)
year = year + 1 // year is not function
Loop
txtPopulationGrowth.Text = "World Population" & "will groth to 8 Billion in" & year.ToString() & "."
End Sub
End Class
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.