import javax.swing.JOptionPane;
public class graficaly_banking_program {
public static void main(String[] args) {
while(true)
{
int ad,f,bd,amount=7000,password=1122,deposite,withdrawn;
String a=JOptionPane.showInputDialog("Enter your password:");
password=Integer.parseInt(a);
if(password==1122)
{
a=JOptionPane.showInputDialog(null,"1=amount\n 2=withdrawn\n 3=deposite\n 4=exit\nEnter your chose:");
f=Integer.parseInt(a);
switch (f)
{
case 1:
JOptionPane.showMessageDialog(null,"Your amount is:" +amount);
break;
case 2:
a=JOptionPane.showInputDialog("Enter your deposite balance:");
deposite=Integer.parseInt(a);
deposite=amount+deposite;
JOptionPane.showMessageDialog(null,"your new balance is " + deposite);
break;
case 3:
a=JOptionPane.showInputDialog("enter your withdrawn amount:");
withdrawn=Integer.parseInt(a);
withdrawn=amount-withdrawn;
JOptionPane.showMessageDialog(null,"your new balance is " + withdrawn);
break;
case 4 :
System.exit(0);
default :
JOptionPane.showMessageDialog(null,"your choice is wrong. ");
}
}
else
JOptionPane.showMessageDialog(null,"wrong password.");
}
}
}
0 comments:
Post a Comment