Microscopic approach to the monopole and quadrupole giant resonances