📄 calculatetaxes.java
字号:
import javax.swing.*;
import java.text.*; // needed for formatting
public class CalculateTaxes
{
public static void main(String[] args)
{
double taxable, taxes;
String s1;
DecimalFormat df = new DecimalFormat(",###.00");
s1 =JOptionPane.showInputDialog("Please type in the taxable income:");
taxable = Double.parseDouble(s1);
if (taxable <= 20000.0)
taxes = 0.02 * taxable;
else
taxes = 0.025 * (taxable - 20000.0) + 400.0;
JOptionPane.showMessageDialog(null, "Taxes are $" + df.format(taxes),
"Program 4.1",
JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -