A simple molecular-orbital theory of the nonlinear optical properties of group III-V and II-VI compounds