Density=mass/volume, so volume=mass/density.
Volume of A=3/2.7=10/9 cm3.
Mass=volume×density.
Volume of B=2.4dm3. 1dm (decimetre)=10cm, so 1dm3=1000cm3.
Volume of B=2400cm3. Mass of B=2400×4.8=11520g.
Total mass of A and B=3+11520=11523g.
Total volume of A and B=10/9+2400=21610/9.
Density=11523×9/21610=4.799g/cm3. This is close to B's density and is expected because B is much more massive than A, so A is almost negligible. However, this is based on the assumption that 1dm=0.1m while 1cm=0.01m.
If dm should have been cm, then the mass of B would have been 2.4×4.8=11.52g.
Total mass of A and B=3+11.52=14.52g.
Total volume of A and B=10/9+2.4=158/45cm3.
Density=14.52×45/158=4.135g/cm3. This seems to me to be the expected answer.