Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class Welcome {
- public static void main(String[] args)
- {
- String inputa = JOptionPane.showInputDialog(null,"What is the radius?","I like turtles",JOptionPane.QUESTION_MESSAGE);
- double radius = Double.parseDouble(inputa);
- String inputb = JOptionPane.showInputDialog(null,"What is the length?","I like turtles",JOptionPane.QUESTION_MESSAGE);
- double length = Double.parseDouble(inputb);
- double double pi = 3.14159; //Wanted to use static double ;(
- double area = radius * radius * pi;
- double volume = area * length;
- System.out.println("The volume is " + volume);
- }
Add Comment
Please, Sign In to add comment