Basic circuit analysis
I think you have a problem understanding the nature of electrical potential. The electrical potential is always measured relatively. That means , if we say a battery is 10V, it is measured with respect to it's negative terminal. When it connected to a circuit the potentials can be different because the current is flowing.

In your question, you are asked to find the voltage with respect to ground,not the negative terminal of the circuit. So you need to apply V=IR to 2ohm resistor and find the voltage drop across it to calculate the potential at B relative to ground. Then 10V is added to the potential of B to find potential at A.

Hope this helps :-)