The formula of the compound is xy.
This means that one mol of x combines with one mol of y. The proportion is 1:1
The number of moles in 22.42 g of x is equal to this weight divided by its atomic mass: # moles of x = 22.42 g / 22. 99 g/mol = 0.975207
Then the number of moles of y is the same and you can calculate the atomic mass by dividing the mass by the number of moles:
aomic mass = weight in grams / # of moles = 34.56 g / 0.975207 mol = 35.44 g/mol = 35.44 amu.