Long: If you know how the battery discharges (in German we say "Entladekurve", IIRC... look for something like a "discharge diagramm") you can make an educated guess on how much capacity is left in the Battery if you know its charge, measured by a Voltmeter. This works better for NiCd Akkus, not so good for NiMH types and even less for Lithium-Ion batteries (all IIRC, of course). If you dig a little deeper you might find out that most battery charge displays in electronic devices work like that, they're inaccurate at best and useless in the worst case.

What exactly do you want to do with it? If it's for a school project I assume you must have gotten *some* instructions on what to do, don't you?

If all you want to find out is if there is *some* charge left in the device you can of course use a Voltmeter - this doesn't tell you anything about quantity, though. D-Size batteries should be somewhere in the region of 1-1.2 V for rechargeable batteries and somewhere around 1.2-1.5 V for single use batteries (alkaline/zinc carbon). If it's much lower than that you can assume that the battery is dead.