2004 Nissan Maxima • 14,000 miles

I have a 2004 nissan maxima se and for the past week it has been giving me problems starting. The check engine light is on. It will turn over with no problem, but it is like it is not getting gas. Especially after I stop to go to the store or if it has been shut off for a short period of time it is worse to where I have to keep cranking it for 5-10 minutes (not continuous) before it will finally turn over. If it has been sitting for the night or the 8-9 hours I'm at work it will usually start on the first crank. I was told it was the mass air flow sensor, so I changed that out, but still no better. It has 140,000 miles. I just got the codes from the Auto Zone and they are P0340 camshaft position sensor and 02 sensor bank 1. Are these a hard fix? Where are they located. Any idea on cost? Thanks
August 14, 2012.

Scan for codes and check fuel pressure with a gauge first

Aug 14, 2012.