Java Program to Calculate Volume of Dodecahedron

bookmark

import java.io.*;
class Main
{
    public static void main(String [] args)
    {
    int l = 5;
    // formula to find volume of dodecahedron
    double volume = (l*l*l)*(15+7*(Math.sqrt(5)))/4;    
    System.out.println("The volume of dodecahedron is " + volume);
    }
}

 


Output:

The volume of dodecahedron is 957.8898700780791