//example-17.4 //page no-526 //given //one mole of magnesium weighs MMg=0.0243 //Kg //current density I=20*10^-3 //A/m^2 //design life of 15 years t=15*365*24*3600 //sec //charge= 2 faradya Q=2*96490 //C //charge needed per m^2 of structure's for design life q=I*t //A s //the amount of magnesium needed AMg=MMg*q/Q //kg/m^2 printf("the amount of magnesiun meeded is %f kg/m?^2",AMg)