dies while running on 2002 Nissan Sentra

Yesterdsay my car died after running for about 15 mins, and wouldn't restart. I couldn't hear the fuel pump turn on so I changed it out. Car started right up, and ran for about 15 to 20 mins, then died again. once again wouldn't restart. This morning started right up, but now the check engine light is on. Obviously its something electronic. I don't knbow if I can make it to Autozone to hook it up to the computer. Any ideas?

Asked by for the 2002 Nissan Sentra
two things... clean the mass air sensor with that special cleaner (sensor cleaner) try it (provided air filter is new and clean

If still fails it is deffinatly the crank sensor
1 more answer
I had this problem. I was driving and the car cut off. It turned out to be the crank shaft sensor gone bad. It ran me about $200 through the dealer.