Hear to echo Iman23, talk to the professor. If you've done so well in the rest of the class he or she may be willing to
work out some option to improve the grade. Also, while it feels disastrous and depressing right now, remember that very few things in life are irredeemable. You'll figure out a way around this and be just fine.