#include "Atom.h"
using namespace std;

/***
 * MoleculeCounter sets the two referenced parameters to the 
 * total number of neutrons and electrons found in the Molecule array.
 *
 * AtomsInMolecule represents the number Atoms in Molecule.
 *
 * MoleculeCounter returns the total number of protons in the molecule.
 */
int MoleculeCounter( const Atom Molecule[], const int AtomsInMolecule,
		int& totalNeutrons, int& totalElectrons )
{
	// set to 0
	totalNeutrons = totalElectrons = 0;
	int protons = 0;
	for( int i=0; i<AtomsInMolecule; i++ ) {
		protons += Molecule[i].getProtons();
		totalNeutrons += Molecule[i].getNeutrons();
		totalElectrons += Molecule[i].getElectrons();
	}
	return protons;
}

