⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checklimit.java

📁 《A first book of java》by Gary J.Bronson 北大出版社
💻 JAVA
字号:
import javax.swing.*;
import java.text.*;  // needed for formatting
public class CheckLimit
{
  public static void main(String[] args)
  {
    final double LIMIT = 3000.0;
    String s1;
    double mileage;
    System.out.println("Please enter the mileage: ");
    mileage = Double.parseDouble(s1);
     
    if(mileage > LIMIT)
      JOptionPane.showMessageDialog(null, "For a mileage of " + mileage 
                      + "\nThis car is over the mileage limit", "Program 4.3", 
                      JOptionPane.INFORMATION_MESSAGE);
    
    JOptionPane.showMessageDialog(null, "End of Program", "Program 4-3", 
                                  JOptionPane.INFORMATION_MESSAGE);
    
    System.exit(0);  
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -