Think of the slope-intercept formula:
y = mx + b
In the former's case, we have: -5 = mx + b
No matter what x equals, y will always be -5. This means m = 0, because anything times 0 equals 0 (the b in this case would equal the negative five).
In the latter case, the input stays exactly the same: 1. The output--the y-- would be any possible answer, making it infinity, or in more basic mathematical terms, dividing by 0. Since we cannot do either case (infinite outputs for one input or x/0), the latter does not have a slope at all.