Hi, and welcome to the digital world!!!!
"Take 2 pictures and then get two prints made......"
While I understand the concept of this I think making a major purchase on the results of such a test are potentially flawed unless you are not going to be getting involved in any PP workflow.
If you looked at many of my files straight out of camera you'd probably put my D2x in the bin compared to many others!
Digital Cameras are IMHO "data" collectors. How you set the camera up to collect that data (not quiet the same as film in some cases) whether you decide to "in camera" tweak or wait until PP is a personal choice. What RAW convertor do you use - different ones have different strengths! Also with certain software you can emulate film looks, or even different camera looks. But ultimately how well you use whatever team of body, lens, tripod, filters, technique, etc to collect the data will be of significant importance to the overall technical potential of your image.
How that image is prepared for print, choice of paper etc will also have a noticeable effect, and if framing the choice of matt and frame too!
I agree that many "digital" prints that I see in local shows, for sale in various shops / stands etc are poor compared to well made film and digital prints. I think this stems from the fact that while many traditional Dark Room prints are created with a wealth of experience by their creators, many digital printers are still inexperienced in both image digital data collection / PP manipulation / and printing.
Other factors are that a D40 sensor isn't like a D2x or D3. Digital is not like film when my F301 with the same film as an F3 could produce essentially the same output and print potential. So here we go back to the collected Data "potential" again.
It certainly does not help with web sites / printers etc that tell provide far too friendly feedback. Try finding a local camera club / workshop / gallery for some real thoughts and hopeful advice, although even there be careful of personal issues which may effect the advice you get - it's a tough world at times!
All the very best
Steven