Please solve with explanation

Answer:
k=0 or 4
Step-by-step explanation:
[tex]y=x^2+(k+4)x+3k+4\\=x^2+(k+4)x+(\frac{x+4}{2})^2 +3k+4-(\frac{x+4}{2})^2\\=(x+\frac{x+4}{2})^2+3k+4-(\frac{x+4}{2})^2\\[/tex]
so the vertex is at
[tex](-\frac{k + 4}{2}, 3k+4-(\frac{x+4}{2})^2)[/tex]
The vertex lies in the x-axis, so
[tex]3k+4-(\frac{k+4}{2})^2 = 0\\4(3k+4)-(k+4)^2=0\\12k+16-k^2-8k-16=0\\-k^2+4k=0\\-k(k-4)=0\\k-0, 4[/tex]