For the first function, your method for finding k is correct. Check that you have copied the function down correctly (looks like x=5 is missing, but this may be intentional).

Your method for the expected value of the first function is correct.

For the variance, i think your notes said "[Sum of (value-mean)^2] * Prob of value"

In the continuous case, you need to use integration. The pdf must integrate to 1 over its range