Java Code for Conical Frustum

This java programming code is used to find the conical frustum . You can select the whole java code by clicking the select option and can use it. When you click text, the code will be changed to text format. This java program code will be opened in a new pop up window once you click pop-up from the right corner. You can just copy, paste this java code and use it to find the conical frustum .

import java.util.*;
import java.lang.*;
class ConicalFrustum
{  
    public static void main(String args[])
    {
        double v,top,r,s,l,t,b,r1=10,r2=12,h=5;
        v=(1.0/3.0 )* 3.14* h*(Math.pow(r1,2)+Math.pow(r2,2)+(r1*r2));
        s =Math.sqrt(Math.pow((r1-r2),2)+Math.pow(h,2)) ;
        l=3.14*(r1+r2)*s;
        top=3.14*Math.pow(r1,2);
        b=3.14*Math.pow(r2,2);
        t=3.14*(Math.pow(r1,2)+Math.pow(r2,2)+(r1+r2)*s);
        System.out.println("Volume = "+v);
        System.out.println("\nSlant Height = "+s);
        System.out.println("\nLateral Surface Area = "+l);
        System.out.println("\Top Surface Area = "+top);
        System.out.println("\nBase Surface Area = "+b);
        System.out.println("\nTotal Surface Area = "+t);
    }
}
Other Programming Codes
Online Calculator : Conical Frustum Calculator
Click on the select code link to copy and paste this free java program code for conical frustum calculator.

english Calculators and Converters

Ask a Question


Sitemap