That looks like you forgot to remove the lens cap
But in earnest: With ISO 800, F4.8 you should at least have some detail on the pic even with 1/4000 sec shutter speed. With your priority set to this shutter timing, the cam tries everything to capture enough light i.e. open the aperture to the max and rise the ISO, BUT it will not choose a slower shutter!
If the scene you were trying to capture was quite dark, then the D40 could do nothing to capture a sensible pic. I just tried the same combination inside my room with daylight but no direct sun. The pic turned out to be VERY dark.
So I suggest:
1. Try "shutter priority" with a longer exposure time say 1/125 or 1/60 sec.
2. Watch the display, what aperture the camera chooses to match your shutter speed. If this is wide open (say around F4) choose an even longer exposure time, until the aperture goes to F5,6 or higher
3. If you try other modes than automatic, just stick first with one (like shutter prio) and try to get acquainted with it.
If (1) and (2) don't help with a normal daylight scene, I would suppose, that there is something seriously misadjusted with your cam
As to your question with regard to program mode, I assume this can be done, but the controls on the D40 are other than in the D80, so I can't tell.
Gordon, can you help here?
Thomas (beware: Nikon-fanboy and moderator!) My Lens Reviews
, My Pictures
, My Photography Blog