I have a 2005 Nissan Sentra. The following happened twice within a few days:

1. I stopped at a red light. When the light turned green, pressing the gas pedal had no effect at all. However, the car would still move forward at idling speed while in drive (about 3-4 km/h), regardless of the pedal.
2. If I put the car in neutral and pressed the gas pedal, the engine would rev normally. Putting it back in first, second or drive would again make the gas pedal non-functional. I can floor it with no effect, as if the pedal was disconnected. I think I was hearing a whine with a pitch proportional to the depth of the pedal, but I'm not sure.
3. The first occurrence was at the end of a 30 minute drive. I drove like this for several minutes (I was close to my destination), at which point the problem disappeared: I pressed the gas pedal and the engine responded normally.
4. The second occurrence was two or three minutes after starting a drive. I pulled over and put the car in park. A few seconds later, the airbag light came on, followed by the engine oil light. Both flickered wildly for a while, after which the engine stalled. I attempted to restart it several times, but it behaved as if the battery was dead: it would turn once or twice without starting, then eventually just a clicking sound.

At that point, I left the car there overnight and called a tow truck the next day. While waiting for the towing I started the car several times without problems and was able to drive it successfully in a parking lot.

I then put it in park, turned on the lights, heating and radio (anything that used electricity), waited a minute, turned off the engine and unsuccessfully attempted to restart it. It had the same symptoms as before: a few turns without starting, then clicking sounds.

The tow truck guy checked a few things before towing the car:

1. He jump started the car successfully. While in park, the gas pedal would behave normally and rev up the engine.
2. He unhooked the jump starter while the engine was running. At that point, the RPM needle on the dashboard went down to 0 even though the engine still seemed to be running (albeit very slowly, but without stalling). The gas pedal became non-functional.
3. He measured a relatively stable ~7.10 volts on the battery.
4. He hooked back the jump starter and the RPM and gas pedal went back to normal.

The conclusion was a bad alternator, which was changed this morning.

**Can all of these symptoms be explained by a bad alternator? Is there something else I need to check or have replaced?**