Professional Documents
Culture Documents
Banking Transaction Java Program
Banking Transaction Java Program
*;
class Bank
{
Scanner t=new Scanner(System.in);
//Declarations//
int f=0;
String c_name,add;
double bal,a_no,phone;
String[]address={"Kanyadi","Ujire","Dharmasthala","Ujire","Dharmasthala","Puttur","
Ujire","Ujire","Kayarthadka","Ujire"};
double[]phno={98598,85888,96698,99862,985549,81488,985225,68522,98872,27852};
double[]balance={10000,15000,15000,6000,4923,8579,5862,8695,7485};
double[]acc_no={12345,23456,34567,45678,56789,67890,78901,89012,90123,01234};
String[]cname={"Amare","Vivek","Ashwin","Smitha","Anvitha","Ramya","Harsha","Shrees
ha","Prathwin","Amruth"};
double[]password={200202,20223,200225,200222,200224,200227,200226,200216,200219,200
284};
//Login Validation//
Bank(double a,double p)
{
for(int i=0;i<10;i++)
{
if(a==acc_no[i]&&p==password[i])
{
System.out.println("Login Successful");
f=1;
bal=balance[i];
c_name=cname[i];
a_no=acc_no[i];
add=address[i];
phone=phno[i];
}
}
if(f!=1)
{
System.out.println("Login Failed. Try again...");
}
}
//Input Checking//
void Input()
{
double acc_d,pass_d;
System.out.println("Please Login to continue the process \n");
System.out.print("Enter your Account Number:");
acc_d=t.nextDouble();
System.out.print("Enter the password:");
pass_d=t.nextDouble();
}
//Deposit Process//
void Deposit()
{
System.out.print("Enter Deposit Amount: ");
double deposit=t.nextDouble();
bal=bal+deposit;
System.out.print("Deposit of Rs."+deposit+" is successful");
}
//Withdraw Process//
void Withdraw()
{
int status=Proceed();
if(status==1)
{
System.out.print("Enter the amount: ");
double withdraw=t.nextDouble();
bal=bal-withdraw;
System.out.print("Withdraw of Rs."+withdraw+" successful");
}
else
{
System.out.println("Insufficient Account Balance");
}
}