Which is the correct description of the function of a motor?

A: to turn rotational movement into electrical energy
B: to turn electrical energy into a magnetic field
C: to turn a varying electrical current into sound
D: to convert electrical energy into rotational movement

D: to convert electrical energy into rotational movement