Answer: a) 
b) 
Explanation:
a) If percentage are given then we are taking total mass is 100 grams.
So, the mass of each element is equal to the percentage given.
Mass of C = 15.8g
Mass of S= 84.2 g
Step 1 : convert given masses into moles.
Moles of C =
Moles of S=
Step 2 : For the mole ratio, divide each value of moles by the smallest number of moles calculated.
For C = 
For S =
The ratio of C : S = 1:2
Hence the empirical formula is 
b) Mass of C= 40 g
Mass of H= 6.7 g
Mass of O = 53.3 g
Step 1 : convert given masses into moles.
Moles of C =
Moles of H =
Moles of O =
Step 2 : For the mole ratio, divide each value of moles by the smallest number of moles calculated.
For C = 
For H = 
For O =
The ratio of C : H: O= 1 :2: 1
Hence the empirical formula is 