Amoxicil
import javax.swing.JOptionPane;
public class ComputeVolume {
    public static void main(String[] args){
        final double PI = 3.14;
        double volume;
        String inputRadius = JOptionPane.showInputDialog(null,"plz enter a radius:",
                "Input Dialog Demo",JOptionPane.QUESTION_MESSAGE);
        String inputHeight = JOptionPane.showInputDialog(null,"plz enter a height:",
                "Input Dialog Demo",JOptionPane.QUESTION_MESSAGE);
        double radius = Double.parseDouble(inputRadius);
        double height = Double.parseDouble(inputHeight);
        volume = (int)(radius * radius * PI * height);
        JOptionPane.showMessageDialog(null, "the Volume is :" + volume);
    }
}

 

分类:

技术点:

相关文章:

  • 2022-02-22
  • 2021-07-16
  • 2021-12-01
  • 2021-07-08
  • 2021-12-16
  • 2022-01-18
  • 2022-01-02
猜你喜欢
  • 2021-12-02
  • 2022-02-20
  • 2022-02-15
  • 2022-02-21
  • 2021-12-11
  • 2022-01-29
  • 2022-03-01
相关资源
相似解决方案