What is wrong with your code right now?

I can see one potential logistic mistake and 2 errors that your compiler should catch:
Logistic Mistakes
In the following calculations in your main:
...