yo dude first off megapixels dont DEFINE quality sry to tell ya and dude dont bother with the d40 there pieces of junk and i wouldn't use a pentax if it was the last camera on earth i would aim for an older nikon such as a Nikin D70s or a D50 i've owned both and there great bodies and might i add bullet proof cameras and then considering u can obtain one of those buddies for under 400 and that leaves with a decent budget towards investing into a new lense and for lenses i would strongly suggest eitehr buying a 50mm 1.8 or a 18-70 3.5-4.5 lense there both great beginner lenses and both offer there own qualities and with 400 bux u could probaly buy both.
Megapixels are a reference to image size not image quality. Most of the time the two come hand in hand, but a 12 megapixel point and shoot isn't about to outperform my 10 megapixel D80.
point and shoot are compact sensors. Not full size. And megapixels are the number of pixels in a given area. NOT the size of the image.
What about the Nikon D60, it is on sale right now at best buy i think 749$
10.2 megapixels (great) 1/200 sync speed (lower than I'd ever want to go, but insignificant if your not shooting high speed objects with a flash) 3 fps with 1/200 shutter speed or faster, and manual focus (pretty damn good) ISO 100 - 1600 (100 is awesome for daylight shooting, my camera only goes as low as 200) Single point, dynamic, and closest subject focus modes (pretty standard, but some camera have weird ones)
In my opinion, it would be good for the price. I'm assuming that is with a kit lens (more than likely 18-55 F3.5/4.7-5.6). Thats about what I paid for my d50, but it is much better. I think you may have found a winner