package bankmanegment;
import java.util.Scanner;
class Bank
{
public String name,actype;
public long acnum;
public float opbal;
Scanner scanner = new Scanner (System.in);
void openac()
{
System.out.print("Enter Your Name => ");
name=scanner.nextLine();
System.out.print("Enter Account Number =>");
acnum=scanner.nextLong();
System.out.print("Seclect Ac Type \n 1.Saving ac \n 2.Curent ac \n 3.Joint ac \n");
System.out.print("Select Your Ac Type => ");
int n=scanner.nextInt();
switch(n)
{
case 1 :
{
actype = "Saving";
break;
}
case 2 :
{
actype = "Current";
break;
}
case 3 :
{
actype = "Current";
break;
}
}
//String actyp = scanner.nextLine();
System.out.print("Enter Your Ac Opening Bal => ");
opbal=scanner.nextFloat();
}
void showac()
{
System.out.println("Account Holder Name => "+name);
System.out.println("Account Holder Number => "+acnum);
System.out.println("Account Type => "+actype);
}
void deposite()
{
float deposit;
System.out.print("Enter Diposit Ammount => ");
deposit = scanner.nextFloat();
opbal+=deposit;
System.out.print("Enter Your Ac Opening Bal => "+opbal);
}
void withdraw()
{
int wd;
System.out.print("Enter Withdraw Ammount => ");
wd=scanner.nextInt();
if(wd>opbal)
{
System.out.print("\nPLEASE MENTEN BALENCE IN YOUR AC !!");
}
else
{
System.out.print("\n AFTER WHITHDRAW AC BAL => "+opbal);
}
}
void serch()
{
long ser;
System.out.print("ENTER AC NUMBER => ");
ser=scanner.nextLong();
if(ser==acnum)
{
System.out.print("Account Holder Name => "+name);
System.out.print("Account Holder Number => "+acnum);
System.out.print("Account Type => "+actype);
System.out.println("Currant Balence In Your Ac => "+opbal);
}
else
{
System.out.print("NOT FOUND YOUR AC ");
}
}
}
public class Bankmanegment
{ public static void main(String[] args)
{
int se;
do
{
System.out.println(" \t\t\t Welcome to Axis ATM Banking ");
System.out.print("\n 1.OPEN ACCOUNT ");
System.out.print("\t 2.SHOW ACCOUNT ");
System.out.print("\n 3.DEPOSITE AMMOUNT ");
System.out.print("\t 4.WITHDRAWALL AMMOUNT ");
System.out.print("\n 5.SEARCH ACCOUNT ");
System.out.print("\t 6.CANCEL TRANSTECTION & EXITE ");
System.out.print("\n\n\t\tCHOOSE ANY BANKING FACILITY = ");
Scanner scanner = new Scanner(System.in);
se = scanner.nextInt();
Bank b1 =new Bank();
switch(se)
{
case 1 -> {
b1.openac();
break;
}
case 2 -> {
b1.showac();
break;
}
case 3 -> {
b1.deposite();
break;
}
case 4 -> {
b1.withdraw();
break;
}
case 5 -> {
b1.serch();
break;
}
case 6 -> {
System.out.print("THANKS FOR VISIT YOU ARE EXITE ");
}
}
}
while(se!=6);
}
}