import java.util.*;
class data
{
long wbal,debal;
long checkbal=1000l,savbal=1000l;
long accno=1234567890,acountnum;
public void name()
{
String firstname,lastname;
firstname="vivek";
lastname="bhardwaj";
System.out.println("the name of acountee is "+firstname);
System.out.println(""+lastname);
}
public void transaction()
{
System.out.println("enter your account no");
Scanner obj=new Scanner(System.in);
acountnum=obj.nextLong();
if(acountnum==accno)
{
int val;
Scanner bj=new Scanner(System.in);
System.out.println("enter the choice:");
try
{
char ch=bj.nextChar();
Switch(ch)
{
case 's': { System.out.println(" this is your saving account");
System.out.println("what you want to do ?");
System.out.println("press 0 for withdrawal ");
Scanner obj1=new Scanner(System.in);
val=obj1.nextInt();
if(val==0)
{
System.out.println("enter the amount for withdrawl");
Scanner obj2=new Scanner(System.in);
wbal=obj2.nextLong();
if(wbal<=savbal)
{
savbal=savbal-wbal;
System.out.println("the remaining balance is"+savbal);
}
else
{
System.exit(0);
}
}
else
{
System.out.println("enter the amount to be deposited");
Scanner obj3=new Scanner(System.in);
debal=obj3.nextLong();
savbal=savbal+debal;
System.out.println("current balnce is "+savbal);
}}
break;
case 'c': System.out.println(" this is your checking account");
System.out.println("what you want to do ?");
System.out.println("press 0 for withdrawal ");
Scanner obj4=new Scanner(System.in);
val=obj4.nextInt();
if(val==0)
{
System.out.println("enter the amount for withdrawl");
Scanner obj5=new Scanner(System.in);
wbal=obj5.nextLong();
if(wbal<=checkbal)
{
checkbal=checkbal-wbal;
System.out.println("the remaining balance is"+checkbal);
}
else
{
System.exit(0);
}}
else
{
System.out.println("enter the amount to be deposited");
Scanner obj6=new Scanner(System.in);
debal=obj6.nextLong();
checkbal=checkbal+debal;
System.out.println("current balnce is "+checkbal);
}
}
break;
default: System.exit(0);
}
}
catch (Exception e)
{
System.out.println("");
}
}
else
{
System.exit(0);
}
}
}
class banksys
{
public static void main(String args[])
{
data d1=new data();
d1.name();
d1.transaction();
}
}