In exercise, question 1.9, the dipole moment is along +ve z - axis. How and why?

In exercise, question 1.9, the dipole moment is along +ve z-axis. How and why?