I'm currently doing a school assignment. The aim is to basically find out the amount of animals there are remaining when a certain percentage is wiped out, you then enter the amount of years that the species of animal is declining.
I have 3 textboxes, a calculate button and a label to display my answer.
I'm not 100% what equation to use.
My equation
1000 * (1 - 0.50) ^ 2
1000 animals, they are reducing 50% every year for two years.
The code(from the top of my head, can't access the program at the moment):
(Under my calculate button)
The problem is that it isn't working, any ideas?
I have 3 textboxes, a calculate button and a label to display my answer.
I'm not 100% what equation to use.
My equation
1000 * (1 - 0.50) ^ 2
1000 animals, they are reducing 50% every year for two years.
The code(from the top of my head, can't access the program at the moment):
(Under my calculate button)
Code:
Dim animals, rate, year, answer as Integer
animals = txtAnimals.Text
rate = txtRate.Text
year = txtYear.Text
answer = lblDisplayNum.Text
lblDisplayNum.Text = animals * (1 - rate) ^ year