hey there:
a) atomic mass:
Carbon =12.0107 g/mol
Hydrogen = 1.00794 g/mol
Oxygen = 15.9994 g/mol
Therefore:
C12H22O11 =
12 * 12.0107 + 1 * 1.00794 + 16 * 15.9994 => 342.29648 g/mol
__________________________________________________________
b) number of moles:
n = m / mm
n = 3.115 / 342.29648
n = 0.0091 moles
________________________________________________
hope this helps!