#importing modules
import math
from __future__ import division
#Variable declaration
e=1.6*10**-19; #charge(coulomb)
x=9*10**9;
r0=2.81*10**-10; #equilibrium distance(m)
A=1.748; #madelung constant
n=9; #repulsive exponent value
#Calculations
U0=-(x*A*e/r0)*(1-1/n); #potential energy(eV)
#Result
print "potential energy is",round(U0/2,3),"eV"
#importing modules
import math
from __future__ import division
#Variable declaration
e=1.6*10**-19; #charge(coulomb)
x=9*10**9;
r0=3.56*10**-10; #equilibrium distance(m)
A=1.763; #madelung constant
n=10.5; #repulsive exponent value
IE=3.89; #ionisation energy(eV)
EA=-3.61; #electron affinity(eV)
#Calculations
U0=-(x*A*e/r0)*(1-1/n); #ionic cohesive energy(eV)
U=U0+IE+EA; #atomic cohesive energy(eV)
#Result
print "ionic cohesive energy is",round(U0,2),"eV"
print "atomic cohesive energy is",round(U,2),"eV"
#importing modules
import math
from __future__ import division
#Variable declaration
N=6.02*10**26; #Avagadro Number
e=1.6*10**-19; #charge(coulomb)
x=9*10**9;
r0=0.324*10**-9; #equilibrium distance(m)
A=1.748; #madelung constant
n=9.5; #repulsive exponent value
#Calculations
U0=(A*e*x/r0)*(1-1/n);
U=round(U0,2)*N*e*10**-3; #binding energy(kJ/kmol)
#Result
print "binding energy is",int(U/10**3),"*10**3 kJ/kmol"
print "answer in the book varies due to rounding off errors"