As the title stated, and a bit more in depth, it's due soon but I can be a bit late. Further, I am using the try/catch method because the professor wants exceptions caught. He suggested earlier in the class I ask here if I need help so here I am. The actual formula for calculation is supposed to be future value = investment * (1 + interest rate) ^ years held. Some calculations work, others don't and I can't find a single reason why. Any help is appreciated, Thanks.

I tried at least 5 different methods of math.pow ((long)math.pow, double x and double y). I eventually settled on math.pow (invest*rate, years), with rate being the textbox + 1.

```
try
{
//setting up some numbers to be parsed.
double InvestO = double.Parse(Investment_Textbox.Text);
double InterO = double.Parse(Interest_Textbox.Text);
double YearO = double.Parse(Years_Textbox.Text);
double RateO = 1+InterO;
//the actual calculation
Future_Textbox.Text = Math.Pow((InvestO * RateO), YearO).ToString("C");
} // end of the try coding
```

I expected it to be accurate or at least match the test data the professor gave (2000 amount, 0.15 interest, 5 year=4022.71) but in actuality it gave me something like 43 trillion or more.

It's the interest that needs to be powered, not the whole amount. You've decided to use the formula:

This expands to:

Haven't done the math but quadrillions seems about right

If you're compounding 15 pc interest over 5 years it's:

So initial amount boosted by 15 per event every year for 5 years

This means your prof's formula vs your formula is:

I'd hence suggest:

All you have to do now is get the values from your textboxes into the variables:

I'll leave assembling the whole thing to you (this is an academic exercise after all)

Some other tips for c# and coding in general: