Exercise: Write a function that will convert grams of
a substance to moles. The function should get the weight of the
substance in grams and the molecular mass of the substance as input
from the user
and then print out the number of moles of this substance.
You may refer to the following website: http://www.chemteam.info/mole/Grams-to_Moles.html
to help you with the formula to determine the number of moles of a
substance.
For example, in Problem #1 at the link above, we are given 25.0
grams of KMnO4, which has a molecular mass of 158.034
grams/mole. The resulting number of moles is 0.158 mol.
There are several additional practice problems at that link that
you can use to check that your function is working.