Is my camera broken, why is my pictures black?

Okay I bought a nikon d5100 from amazon from reconditioned and it works perfectly but for some reason on the setting that is MASP when I take the photo it comess out black? Idkif there's a problem with my camera or the settings.
Can anyone explain to me?

Did you take the lens cap off?

No setting will make the camera take pictures black. It is indeed broken.

Operator error!
You are underexposing open the aperture and/or decrease the shutter speed and/or increase the ISO until you have proper exposure

MASP is not a single setting - it's 4 settings (M - manual, P - programmed auto, S - shutter priority, A - aperture priority) - which one were you on?
If manual, then YOU have to read the light meter & set the aperture/shutter speed (& ISO) yourself for the correct exposure.
If your pictures are black, that's underexposed - you need to let more light in. That means any or all of the following;
- open up the aperture (smaller f number)
- slower shutter speed
- Higher ISO

Gee, that sounds like my car. When I put it in PRNDL it does not move.

Read this: The Owner's Manual for your camera. If you don't have it you can order a copy or download it from the Nikon website.
Watch this: http://www.nikondigitutor.com/eng/d5100/index.html
Read this: http://www.digital-photography-school.com/learning-exposure-in-digital-photography

Put it in the AUTO position - green letters - and try some shots.