The variable 'i' is undeclared on line 36 because it is outside of the for loop. Look up variable scope.

Oh wow, talk about lazy... you didn't even attempt to solve the actual problem... you just wrote some simple output and an IF statement. And the assignment called for floating point numbers, not doubles...
If you aren't will to make a serious attempt at the program yourself, nobody here is going to so much as reply to your thread, except perhaps to tell you to do it yourself.

<scoff> Good day, sir...