--> //initializations

--> w=10//% (water content)
 w  = 

   10.


--> Y=20 //KN/m^3 (wet unit weight)
 Y  = 

   20.


--> G=2.70 // (specific gravity of solids)
 G  = 

   2.7


--> Yw=10//KN/m^3 (unit weight of water)
 Yw  = 

   10.


--> //calculations

--> Yd=Y/(1+(w/100)) //(dry unit weight)
 Yd  = 

   18.181818


--> e=((G*Yw)/Yd)-1 //(viod ratio)
 e  = 

   0.485


--> S=((w/100)*G*100)/e //(degree of saturation)
 S  = 

   55.670103


--> //results

--> printf('dry unit waight=%f',Yd) //KN/m^3
dry unit waight=18.181818
--> printf('void ratio=%f',e)
void ratio=0.485000
--> printf('Degree of saturation=%f',S) //%
Degree of saturation=55.670103