The mean is 12.1 and the median is 9.
To find the mean you add together all the values (8,8,9,9,9,9,9,10,10,40) and divide the sum (121) by the number of values there are (10). Thus making the mean 12.1.
To find the median, you sort the values numerically, and find the middle-most number. When doing so, you find that there are 2 numbers in the middle of this value set (since there are an even number of values). Since the 2 left-over values are 9, the median is 9.
I hope this helps!