--> //initializations

--> D=50 //mm (diameter of cylindrical specimen)
 D  = 

   50.


--> L=100 //mm (length of  cylindrical specimen)
 L  = 

   100.


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

   15.


--> na=20 //% (air voids)
 na  = 

   20.


--> G=2.69 // (specific gravity)
 G  = 

   2.69


--> Dw=1000 //Kg/m^3 (density of water)
 Dw  = 

   1000.


--> //Calculations

--> l=L/1000 //m (length of specimen)
 l  = 

   0.1


--> d=D/1000 //m (diameter of specimen)
 d  = 

   0.05


--> V=(%pi*l*(d^2))/4 //(total volume of sample)
 V  = 

   0.0001963


--> Va=(na*V)/100 //(volume of air)
 Va  = 

   0.0000393


--> Ms=(V-Va)/((1/(G*Dw))+(w/(100*Dw))) //kg (mass of solids)
 Ms  = 

   0.3010646


--> Mw=(w*Ms)/100 // (mass of water)
 Mw  = 

   0.0451597


--> M=Ms+Mw // (mass of soil)
 M  = 

   0.3462243


--> //results

--> printf('mass of soil =%f',M) //kg
mass of soil =0.346224
--> printf('water required for the preparation of the sample=%f',Mw) //kg
water required for the preparation of the sample=0.045160