There is a mod term in the given integral. So, first we have to remove that. We know that $x$ is always positive here and $\sin x$ is positive from 0 to $\pi$. From $\pi$ to $2\pi$, $x$ is positive while $\sin x$ changes sign. So, we can write
$\int_{0}^{2\pi} \mid x \sin x \mid dx = \int_{0}^{\pi} x \sin x dx + \left(-\int_{\pi}^{2\pi} x \sin x dx \right)$
$\qquad\qquad\qquad\quad\;= \int_{0}^{\pi} x \sin x dx -\int_{\pi}^{2\pi} x \sin x dx.$
$\int_{0}^{\pi}{udv} = uv - \int_{0}^{\pi}{vdu}$
$ \text{Here }u = x, du = dx, dv = \sin x dx, \text{ so } v = -\cos x$
$ \therefore \int_{0}^{\pi} x \sin x dx = \left [ -x\cos x\right]_0^{\pi} + \int_{0}^{\pi} \cos x dx$
$= \pi + \left[\sin x\right]_0^{\pi}\\ =\pi$
$\text{Now, } \int_{\pi}^{2\pi} x \sin x = \left [ -x\cos x\right]_{\pi}^{2\pi} + \int_{\pi}^{2\pi} \cos x dx$
$= -3\pi + \left[\sin x\right]_{\pi}^{2\pi}\\ = -3 \pi$
So, given integral = $\pi - \left(-3\pi\right) = 4\pi$
So, k = 4.