Here's what you would need from JOptionPane:
JOptionPane (Java Platform SE 7 )
Note, that the showInputDialog is static and called with the class name and also returns a String so you'll have to Integer.parseInt() or Double.parseDouble() it to get it into the number format you want. Also, as for the Component param, you can usually pass it null.
Second, the Math class has a method called sqrt() that takes the double as a param and returns a double I think. It is also a static method, meaning that it is called with the class name.
As for the output, this should work
JOptionPane (Java Platform SE 7 )
Note, that again the component param can be null.