Well, fortunately your skill as a programmer is not determined by your grade nor by your math grades - simply by the quality of code you write.
Without knowing you personally and being in the class, I wouldn't be able to tell whether you know your stuff or not. I'm guessing that you'd probably be really good were you offered a practical, usable explanation.
If you're like me, when you go and read some article or your math teacher writes some equation on the board, expecting it to bring some epiphany (Oh, that explains the relationship between x and y type thing), it just goes over your head.
For example: I can tell you all day that C++ lambda expressions are implicitly convertible to function pointers, but unless you see, examine, and understand the practical application of a topic, you don't get the point. That snippet of text is just rote memorization, while the application used isn't.
Programming is NOT theoretical. Only in a school is programming taught like mathematics. What I'd say is put down your textbook and just write some code.
I learned (and still do!) like this:
I would read random articles or some textbook or something, and write down a feature that I want to learn, and what the feature does - and than close the textbook.
Than I would write some code, or open an old project, and see how that feature could possibly improve my code. Than I would try my hardest to implement it, with the aid of whatever I needed.
Being able to see the benefits, effects and results of certain features on code is always a great benefit, and it was only really by that kind of experimentation that I taught myself to program..
Best of luck.