0% found this document useful (0 votes)
5 views5 pages

Java Bank Management System Code

Uploaded by

devrajak1895
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Java Bank Management System Code

Uploaded by

devrajak1895
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Source Code

import [Link];

class Customer {

private String CustomerName;

private long CustomerId;

private double Deposit;

public void setDetails(String n, long i){

[Link] = n;

[Link] = i;

public void setDetails(double s){

[Link] = s;

public int getCustomerId(){ return [Link]; }

public String getCustomerName(){ return [Link](); }

public double getDeposit(){ return [Link]; }

public void withdrawal(){

double amt = [Link]();

if(amt>0 && amt>amt1){

amt= amt -amt;

this. setDeposit(amt);

[Link](“Transaction of “ + amt1+” processed


successfully”);

else{

[Link](“Transaction not processed due to insufficient


balance” );

[Link]();

public void deposit(double d){

double amt = this. getDeposit();


amt = amt + d;

setDeposit(amt);

[Link](“Transactionn successful… Amount deposited.”);

[Link]();

public void showDetails(){

[Link](“Account holder : “ + [Link]());

[Link](“Account Id : “ + [Link]());

[Link](“Account balance : “ + [Link]());

class Employee extends Customer{

private int employeeId;

private String employeeName;

private String Designation;

public void setDetails(int i, String n, String d){

[Link] = n;

[Link] = d;

[Link] = i;

public void printDetails(){

[Link]([Link]());

[Link]([Link]());

[Link]([Link]());

public int getEmployeeId(){ return [Link]; }

public String getEmployeeName(){ return [Link]; }

public String getDesignation(){ return [Link]; }

class Admin extends Employee{

protected int key = 51204;


public boolean check(int a) { return a==key; }

public class BankManagementSystem{

public static void main(String [ ] args) {

Scanner input = new Scanner ([Link]);

[Link](“Welcome to XYZ Bank !!!”);

[Link](“Select your login portal : “);

[Link](“1 – Customer Portal “);

[Link](“2 - Employee Portal “);

[Link](“3 – Admin Portal ");

[Link](“Enter the respective number of the portal : “);

int choice = [Link]();

switch(choice) {

case 1: //Customer Portal

Customer N = new Customer();

[Link](“Enter the customer’s name : “);

String name = [Link]();

[Link](“Enter the customer’s account Number : “);

long id= [Link]();

[Link](“Enter the amount : “);

double dep = [Link]();

[Link](name, id);

[Link](dep);

[Link](“Enter 1 for Withdrawal : “);

[Link](“Enter 2 for Deposit : “);

[Link](“Enter 3 for Checking account balance : “);

int a = [Link]();

switch(a){

case 1 : //Withdrawal

[Link](“Enter the amount you want


to withdraw : “);
double amt1 = (double) [Link]();

[Link](amt1);

break;

case 2 : //Deposit

[Link](“Enter the amount you want


to deposit : “);

double amt2 = (double) [Link]();

[Link] (amt2);

break;

case 3 : //Check Balance

[Link]();

break;

default:

[Link](“Invalid Choice. “);

break;

case 2: //Employee Portal

[Link](“Enter the Employee Id : “);

int eId = [Link]();

[Link](“Enter your Name : “);

String eName = [Link]();

[Link](“Enter your Designation : “);

String designation = [Link]();

Employee e1 = new Employee();

[Link](eId, eName, designation);

[Link]();

break;

case 3 : //Admin Portal

Admin a = new Admin();

[Link](“Welcome to Admin Portal”);

[Link](“Please Enter the security key : “);

int key = [Link]();


boolean c = [Link](key);

if(c) {

[Link](“Welcome Sir, Access Granted. “

} else {

[Link](“Invalid key…Access Denied.”);

You might also like