Anda di halaman 1dari 8

Project on banking system

/*Himanshu Rai(Enrollment ID is HPE-02421),

S/O: Arvind Rai.

HPE Summer Training Program 2017.

*/

import java.util.Scanner;

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

/**

* @author STUDENT

*/

import java.util.Scanner;

public class Account_Open {

static String custName, custFName, custAddress, custDOB, custAType;

static int custANo;

static double acbalance;

Scanner inp = new Scanner(System.in);

void open(){

System.out.println("Enter Your Name:");

custName=inp.nextLine();

System.out.println("Enter Your Father Name:");

custFName=inp.nextLine();
System.out.println("Enter Your Address:");

custAddress=inp.nextLine();

System.out.println("Enter Your Date Of Birth:");

custDOB=inp.nextLine();

System.out.println("Enter Account Type");

custAType=inp.nextLine();

System.out.println("Enter Account No.");

custANo=inp.nextInt();

System.out.println(custName+" Welcome to Dena Bank"+" Your Account No. is:"+custANo);

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

/**

* @author STUDENT

*/

import java.util.Scanner;

public class Banking {

public static void main(String[] args)

int choice=1;

while(choice==1){

int c;

Account_Detail a1=new Account_Detail();


Account_Open ao= new Account_Open();

Transaction tr = new Transaction();

Scanner inp = new Scanner(System.in);

System.out.println(" DENA BANK");

System.out.println("--------------");

System.out.println("Maldhaiya Varanasi");

System.out.println("Enter Your Choice:");

System.out.println("Enter '1' For Account_Opening:");

System.out.println("Enter '2' For Withdrawl:");

System.out.println("Enter '3' For Deposit:");

System.out.println("Enter '4' For Account_Details:");

c=inp.nextInt();

switch(c){

case 4:

System.out.println("Account_Details:");

a1.setinput();

break;

case 1:

System.out.println("Enter Your Information");

ao.open();

break;

case 2:

System.out.println("Withdrawl");

tr.Withdrawl();

break;

case 3:

System.out.println("Deposit");

tr.Deposite();

break;
}

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

/**

* @author Lenovo

*/

public class Account_Detail extends Transaction {

public

void setinput()

{ System.out.println("****************************************");

System.out.println(custName+ "\nYour Account No. is:"+custANo);

System.out.println("Your Account Balance is:"+acbalance);

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

/**

* @author STUDENT

*/

import java.util.Scanner;

public class Transaction extends Account_Open{

Scanner inpu = new Scanner(System.in);

void Withdrawl()

double wd;

double ac;

System.out.println("Enter your Account number:");

ac=inpu.nextDouble();

if(ac==custANo)

System.out.println("WELLCOME");

System.out.println("Enter Amount For Withdrawl");

wd=inpu.nextDouble();

if(acbalance>wd)

acbalance=acbalance-wd;

System.out.println("Your Account Balance is:"+acbalance);

else

{
System.out.println("Your Account Balance is:"+acbalance);

System.out.println("Transaction Failed: Not Enough balance");

else

System.out.println("Invalid account number,please check and try again later");

void Deposite()

double dep;

double ac;

System.out.println("Enter your Account number:");

ac=inpu.nextDouble();

if(ac==custANo)

System.out.println("WELLCOME");

System.out.println("Enter Amount For deposit");

dep=inpu.nextDouble();

acbalance=acbalance+dep;

System.out.println("Your Account Balnce is:"+acbalance);

else

System.out.println("Invalid account number,please check and try again later");


}

Output

Anda mungkin juga menyukai