I have had this car for 10 years and it runs like a champ. I have replaced lots of parts but now I am stumpt. My "loos gas cap" light came on, then the Check Engine light. It runs perfectly then out of the blue it just quits. Then after a minute it starts back up and runs fine. It does not matter if I am driving at highway speeds or sitting at a light. Very random and frusterating. Can it be a fuel flow sensor?
Sounds like you have two different problems. The entire fuel supply system is monitored for a leak by the Engine Computer. The most common cause of a leak in it is a loose gas cap but there's lots of other hoses, valves, and connections. That "Loose gas cap" designation is misleading because there are many other possible causes to check.
When the Check Engine light turns on there will be a diagnostic fault code stored in the Engine Computer. Many auto parts stores will read those codes for you for free but it's important to understand those codes never say to replace parts. They only indicate the circuit or system that needs further diagnosis.