Let's help Electra together.
First, write down the Nernst equation's general form for this reaction. Observe that I haven't included the concentrations of Mg(s) and Ag(s) since these are taken as unity.
Ecell=E∘−2.303RTnFlog([Mg2+][Ag2+]2)
E∘=3.17 V as given in the question.
R=8.314 JK−1mol−1
T=25∘C=298 K
Also, [Mg2+]=0.310 M
[Ag+]=0.0001 M or 10−4 M
To find n, we need to write down the half-reactions of the cell and balance the electrons. Let's do that. Let's take the equation given as reference. We can see that,
Mg→Mg2++2e−
2Ag++2e−→2Ag
So, we see that the reactions is balanced and n = 2
By plugging in all these values, we get
Ecell=E∘−2.303RTnFlog([Mg2+][Ag2+]2)
Ecell=E0−2.303∗8.314∗298n∗96500log(0.1310−3)
If we calculate the value, we'll get Ecell=2.96V. We can round that off to 3 V