Having a wife that is a professor at a state university for the past couple of decades, I find it bewildering how students can know they are failing--or should have known--by mid-term and don't make a decision on to go forward or not. I see no benefit of taking a final if you are going into the final with a hail Mary expectation because the end result is still a mediocre grade at best and only proves to the instructor you could have made a better effort during the semester but didn't.
Now, there are excepts to the above response, which I have seen and even personally experienced. I had one college class that had a text book stated to be the worse textbook on the subject at hand (so said the instructor), started with chapter '0' and we only got a mid-term and final for exams and the mid-term was a week after the last date of drop and also corresponded with moving onto chapter '1'. I actually got my lowest grade in a math subject in that class. There wasn't a single person to make an A and only one person made a B because he got an instant fail on the final for lying.
But beyond those extreme exceptions and especially if you are on some sort of student financial aid you should be in a class governed by the fact that your instructor is informing you of your failing condition by mid-term. Additionally, it is in every student's power to know their state of affairs at any moment and can inquire therein. So, if on the last date to drop a class you are on the fence about getting an acceptable grade on outlook then you should have kept/dropped the class. This is even more important, as someone else stated, if you could better utilize your time on other classes.
On this point I actually spent a lot of time on one class than any other to get an average grade and to the detriment of other classes that had suffering grades because of time spent on them. I vowed to never let that happen before. But of course all of this is hindsight and now that you have posted about this and gotten several responses the Op can and will never find themselves in this situation again ... right?