import javax.swing.*;
class DoubleSample
{
public static void main( String[] args )
{
double x;
double y;
String a;
a = JOptionPane.showInputDialog("Enter a number:");
x = Double.parseDouble(a);
y = Math.pow(x,2);
System.out.println("The result is " + y);
}
}