class carpcalculate{
public static double Perimeter(double l, double b){
double p=2*(l+b);
return p;
}
public static double Area(double l, double b){
double a=l*b;
return a;
}
public static double Volume(double l, double b,double h){
double v=l*b*h;
return v;
}
}
import javax.swing.JOptionPane;
class carpDemo{
public static void main(String args[]){
carpcalculate cc = new carpcalculate();
double l, b, h;
String a=JOptionPane.showInputDialog("please enter the length");
l=Double.parseDouble(a);
String x=JOptionPane.showInputDialog("please enter the breadth");
b=Double.parseDouble(x);
String y=JOptionPane.showInputDialog("please enter the heigth");
h=Double.parseDouble(y);
JOptionPane.showMessageDialog("null,your perimeter is+cc.Perimeter(l,b)");
JOptionPane.showMessageDialog("null,your area is+cc.Area(l,b)");
JOptionPane.showMessageDialog("null,your volume is+cc.Volume(l,b,h)");
}
}