The molar mass of the elements are:
Yttrium (Y) = 88.91 g / mol
Barium (Ba) = 137.33 g / mol
Copper (Cu) = 63.55 g / mol
Oxygen (O) = 16 g / mol
Calculating for the molar mass of YBa2Cu3O7:
YBa2Cu3O7 = 88.91 + 2(137.33) + 3(63.55) + 7(16) = 666.22 g / mol
The masses of the elements in 1 mole of YBa2Cu3O7 are:
Yttrium (Y) = 88.91 g / mol (1 mole) = 88.91 g
Barium (Ba) = 137.33 g / mol (2 mole) = 274.66 g
Copper (Cu) = 63.55 g / mol (3 mole) = 190.65 g
Oxygen (O) = 16 g / mol (7 mole) = 112 g
We now calculate for the percent composition by mass of each element:
% Y = 88.91 g / 666.22 g = 13.35%
% Ba = 274.66 g / 666.22 g = 41.23%
%Cu = 190.65 g / 666.22 g = 28.62%
%O = 112 g / 666.22 g = 16.81%