If it was just a bad battery, why would it quit while running? I would think a bad battery would fail to start, but not quit after already started.
Coach
The battery is what starts the car, the alternator charges the battery and supplies all your other electrical power under normal conditions. On most cars you can start the car and remove the battery, everything will remain running with a good functioning alternator. When an alternator goes, it can't provide enough current to keep everything powered, so the car's system will start to draw power from the battery instead since they are both wired into the car. After a while, the battery's power will drain because now IT is keeping the car running instead of the alternator. Now, without the alternator charging the battery and powering the car - the battery gets drained too far and eventually the engine will stall. At that point the battery is basically dead, and you won't be able to even crank the engine.
I've made it home (the last mile or two) with just a jump pack hooked up to the battery under the hood. It's enough to keep it running for a very short time.
If you throw a voltmeter on the battery terminals, (on a good charged battery) it should read somewhere above 12v just sitting there. 12.3, 12.5 probably. Once you start the car, and place meter across the terminals again, even with everything on like lights, wipers, AC on high - you should see over 14v being pushed to the battery.
Recharge your battery or jump the car. With the engine running, disconnect the battery. If the car dies you need an alternator.