Which of the following describes the primary function of a voltaic cell?
A) To convert electrical energy into chemical energy
B) To generate electrical energy from spontaneous chemical reactions
C) To store electrical energy for future use
D) To catalyze chemical reactions in a solution