A device which converts chemical energy into electrical energy is called——-?

A. Motor

B. Generator

C. Battery

D. Moving-coil meter