A mixture of the compounds magnesium oxide and calcium sulfide contains 21.6999 g of magnesium oxide and is 51.3 % by mass magnesium oxide. The compound calcium sulfide is 44.400 % by mass sulfur. Calculate the moles of sulfur in the mixture.

I'm not sure what I did wrong.
My attempt:
21.6999g CaS2 / molar mass of CaS2 = 0.30079 mol

Answer: 0.285246979573 mol.

Thanks.

21.9999/0.513 = total grams mixture

grams mixture x (1.00-0.487) = g CaS
grams CaS/molar mass CaS = mols CaS
mols S = mols CaS.

To calculate the moles of sulfur in the mixture, you can use the given information about the percentages of magnesium oxide and calcium sulfide. Here's how you can solve it:

1. Calculate the total mass of the mixture:
Since the mixture is 51.3% by mass magnesium oxide, you can calculate the mass of the mixture using the mass of magnesium oxide as follows:
Mass of mixture = (Mass of magnesium oxide) / (Percentage of magnesium oxide)
Mass of mixture = 21.6999 g / 0.513 = 42.282 g

2. Calculate the mass of calcium sulfide in the mixture:
Mass of calcium sulfide = Mass of mixture - Mass of magnesium oxide
Mass of calcium sulfide = 42.282 g - 21.6999 g = 20.5821 g

3. Calculate the moles of sulfur in calcium sulfide:
To do this, you need to know the molar mass of calcium sulfide (CaS).
Molar mass of Sulfur (S) = 32.06 g/mol
Molar mass of calcium sulfide (CaS) = Molar mass of Ca + Molar mass of S = 40.08 g/mol + 32.06 g/mol = 72.14 g/mol

Moles of sulfur in calcium sulfide = (Mass of calcium sulfide) / (Molar mass of calcium sulfide)
Moles of sulfur in calcium sulfide = 20.5821 g / 72.14 g/mol = 0.2852 mol (rounded to four decimal places)

Thus, the moles of sulfur in the mixture is approximately 0.2852 mol, which matches the given answer of 0.285246979573 mol.