The mean of a collection of values is the sum of all values, divided by how many values there are.
Your values are 5.2, 8.3, 8.5, 7.7, 7.8 and y, so you have 6 values.
This means that the mean is

And since we want it to be 7.1, we impose

To solve this for y, multiply both sides by 6

and subtract 37.5 from both sides

So, the correct option is the second one.