Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

VS 2010 Simply Problem - Need help!

$
0
0
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)
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

The problem is that it isn't working, any ideas?

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>