public class Task4 { public static void main(String[] args) { int number1; int number2; double sum; String firstNumber; String secondNumber; firstNumber=JOptionPane.showInputDialog("Enter first number"); secondNumber=JOptionPane.showInputDialog("Enter second number"); number1=Integer.parseInt(firstNumber); number2=Integer.parseInt(secondNumber); if(number1==1){ sum=233.99*number2*0.09+200; } if(number1==2){ sum=129.75*number2*0.09+200; }if(number1==3){ sum=99.95*number2*0.09+200; }else{ sum=350.89*number2*0.09+200; } JOptionPane.showMessageDialog(null, sum,"Results",JOptionPane.INFORMATION_MESSAGE); System.exit(0);}}
添加回答
举报
0/150
提交
取消