Electron densities and resonance interactions in substituted benzenes, ethylenes and acetylenes