// Eg. C6H12O6.NumberOfElement(Carbon) = 6 public int NumberOfElement(Element ele) { int TotalAmount = 0; for(int i = 0; i<elementList.Count();i++) { if (ele.AtomicNumber == elementList[i].element.AtomicNumber) { TotalAmount += elementList[i].amount; } } return TotalAmount; }
public EmpiricalElement(decimal percentageT,Element elementT) { percentage = percentageT; element = elementT; }
public LiveElement(Element elementT, int amountT) { amount = amountT; element = elementT; }