The ratio of x to y is 3:4. Since we know how many atoms of y there are, we can set up a proportion:
Next, we convert the value we just found into moles:
We know how many grams of x there are, so with the help of a little dimensional analysis, we can find the amount of grams
Next, we need to divide this value by three, since there are three atoms of x per every four atoms of y. In another words, the molecular formula given looks something like this:
The element closest to that value of atomic weight is Oxygen, which has a molar mass of 15.9994 grams.