import javax.swing.*;
public class TimeDeposit{
public static void main(String[] args){
String choice1, choice2,monthlySales,income;
int value1, value2;
// to display value of a variable
DecimalFormat num=new DecimalFormat(",###.00");
JOptionPane.showMessageDialog(null,"Monthly Sales In $","Bank", JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(null,"the Interest is 0.025"num.format(monthlySales)+"income is"+num.format(income),"Bank", JOptionPane.INFORMATION_MESSAGE);
choice1=JOptionPane.showInputDialog("The time less than: ");
value1=Integer.parseInt(choice1);
choice2=JOptionPane.showInputDialog("The deposit is greater than: ");
value2=Integer.parseInt(choice2);
switch(value1){
case 1:
JOptionPane.showMessageDialog(null,"the Interest is 0.025","Bank", JOptionPane.INFORMATION_MESSAGE);
break;
case 2:
if(value2>=24){
JOptionPane.showMessageDialog(null,"the Interest is 0.030","Bank", JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane.showMessageDialog(null,"No Interest service for your input","Bank", JOptionPane.INFORMATION_MESSAGE);
}
break;
case 3:
if(value2>36){
JOptionPane.showMessageDialog(null,"the Interest is 0.035","Bank", JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane.showMessageDialog(null,"No Interest service for your input","Bank", JOptionPane.INFORMATION_MESSAGE);
}
break;
case 4:
if(value2>48){
JOptionPane.showMessageDialog(null,"the Interest is 0.045","Bank", JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane.showMessageDialog(null,"No Interest service for your input","Bank", JOptionPane.INFORMATION_MESSAGE);
}
break;
case 5:
if(value2>60){
JOptionPane.showMessageDialog(null,"the Interest is 0.0475","Bank", JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane.showMessageDialog(null,"No Interest service for your input","Bank", JOptionPane.INFORMATION_MESSAGE);
}
break;
default:
JOptionPane.showMessageDialog(null,"No Interest service for you","Bank", JOptionPane.INFORMATION_MESSAGE);
break;
}
}
}
this my assignment
my mentor told me a condition of having 2 decimal places only and calculate it with the rate per certain year
can someone help me please