SlideShare ist ein Scribd-Unternehmen logo
1 von 5
A banking system is a group or network of institutions that provide financial services for
us. These institutions are responsible for operating a payment system, providing loans,
taking deposits, and helping with investments.
“Using this project we will see the amount and total no of transations like credit, debit etc”
 CODE:
package bank_system;
import java.util.Scanner;
public class Bank_system {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter your 'Name' and 'CustomerId' to
access your Bank account:");
String name=sc.nextLine();
String customerId=sc.nextLine();
BankAccount obj1=new BankAccount(name,customerId);
obj1.menu();
}
}
class BankAccount{
double bal;
double prevTrans;
String customerName;
String customerId;
BankAccount(String customerName,String customerId){
this.customerName=customerName;
this.customerId=customerId;
}
void deposit(double amount){
if(amount!=0){
bal+=amount;
prevTrans=amount;
}
}
void withdraw(double amt){
if(amt!=0 && bal>=amt){
bal-=amt;
prevTrans=-amt;
}
else if(bal<amt){
System.out.println("Bank balance insufficient");
}
}
void getPreviousTrans(){
if(prevTrans>0){
System.out.println("Deposited: "+prevTrans);
}
else if(prevTrans<0){
System.out.println("Withdrawn: "+Math.abs(prevTrans));
}
else{
System.out.println("No transaction occured");
}
}
void menu(){
char option;
Scanner sc=new Scanner(System.in);
System.out.println("Welcome "+customerName);
System.out.println("Your ID:"+customerId);
System.out.println("n");
System.out.println("a) Check Balance");
System.out.println("b) Deposit Amount");
System.out.println("c) Withdraw Amount");
System.out.println("d) Previous Transaction");
System.out.println("e) Exit");
do{
System.out.println("********************************************");
System.out.println("Choose an option");
option=sc.next().charAt(0);
System.out.println("n");
switch (option){
case 'a':
System.out.println("......................");
System.out.println("Balance ="+bal);
System.out.println("......................");
System.out.println("n");
break;
case 'b':
System.out.println("......................");
System.out.println("Enter a amount to deposit :");
System.out.println("......................");
double amt=sc.nextDouble();
deposit(amt);
System.out.println("n");
break;
case 'c':
System.out.println("......................");
System.out.println("Enter a amount to Withdraw
:");
System.out.println("......................");
double amtW=sc.nextDouble();
withdraw(amtW);
System.out.println("n");
break;
case 'd':
System.out.println("......................");
System.out.println("Previous Transaction:");
getPreviousTrans();
System.out.println("......................");
System.out.println("n");
break;
case 'e':
System.out.println("......................");
break;
default:
System.out.println("Choose a correct option to
proceed");
break;
}
}while(option!='e');
System.out.println("Thank you for using our banking
services");
}
}
 OUTPUT:
Overall Banking System With step by step process given the image below:
THANK YOU

Weitere ähnliche Inhalte

Ähnlich wie Project on Bank System .docx

Banks offer various types of accounts, such as savings, checking, cer.pdf
Banks offer various types of accounts, such as savings, checking, cer.pdfBanks offer various types of accounts, such as savings, checking, cer.pdf
Banks offer various types of accounts, such as savings, checking, cer.pdf
rajeshjain2109
 
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxCSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
ruthannemcmullen
 
OOP: Classes and Objects
OOP: Classes and ObjectsOOP: Classes and Objects
OOP: Classes and Objects
Atit Patumvan
 
Change to oop formatimport java.util.Scanner;import java.io.;.pdf
Change to oop formatimport java.util.Scanner;import java.io.;.pdfChange to oop formatimport java.util.Scanner;import java.io.;.pdf
Change to oop formatimport java.util.Scanner;import java.io.;.pdf
MAYANKBANSAL1981
 
Appendices
AppendicesAppendices
Appendices
loisy28
 

Ähnlich wie Project on Bank System .docx (19)

Banks offer various types of accounts, such as savings, checking, cer.pdf
Banks offer various types of accounts, such as savings, checking, cer.pdfBanks offer various types of accounts, such as savings, checking, cer.pdf
Banks offer various types of accounts, such as savings, checking, cer.pdf
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxCSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
 
Micro services from scratch - Part 1
Micro services from scratch - Part 1Micro services from scratch - Part 1
Micro services from scratch - Part 1
 
BANK MANAGEMENT SYSTEM.pptx
BANK MANAGEMENT SYSTEM.pptxBANK MANAGEMENT SYSTEM.pptx
BANK MANAGEMENT SYSTEM.pptx
 
A Review on Unified Payment Interface [UPI]
A Review on Unified Payment Interface [UPI]A Review on Unified Payment Interface [UPI]
A Review on Unified Payment Interface [UPI]
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Cbse computer science (c++) class 12 board project bank managment system
Cbse computer science (c++)  class 12 board project  bank managment systemCbse computer science (c++)  class 12 board project  bank managment system
Cbse computer science (c++) class 12 board project bank managment system
 
Distributed banking system using rmi project
Distributed banking system using rmi projectDistributed banking system using rmi project
Distributed banking system using rmi project
 
Week 8
Week 8Week 8
Week 8
 
Dont call me cache java version
Dont call me cache java versionDont call me cache java version
Dont call me cache java version
 
OOP: Classes and Objects
OOP: Classes and ObjectsOOP: Classes and Objects
OOP: Classes and Objects
 
Software Engineering Testing & Research
Software Engineering Testing & Research Software Engineering Testing & Research
Software Engineering Testing & Research
 
How to integrate paytm payment gateway using react js in seven easy steps
How to integrate paytm payment gateway using react js in seven easy stepsHow to integrate paytm payment gateway using react js in seven easy steps
How to integrate paytm payment gateway using react js in seven easy steps
 
Change to oop formatimport java.util.Scanner;import java.io.;.pdf
Change to oop formatimport java.util.Scanner;import java.io.;.pdfChange to oop formatimport java.util.Scanner;import java.io.;.pdf
Change to oop formatimport java.util.Scanner;import java.io.;.pdf
 
Appendices
AppendicesAppendices
Appendices
 
Java Practical File Diploma
Java Practical File DiplomaJava Practical File Diploma
Java Practical File Diploma
 
Stellar wallet
Stellar walletStellar wallet
Stellar wallet
 
3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
 

Kürzlich hochgeladen

scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 

Kürzlich hochgeladen (20)

scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 

Project on Bank System .docx

  • 1. A banking system is a group or network of institutions that provide financial services for us. These institutions are responsible for operating a payment system, providing loans, taking deposits, and helping with investments. “Using this project we will see the amount and total no of transations like credit, debit etc”  CODE: package bank_system; import java.util.Scanner; public class Bank_system { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("Enter your 'Name' and 'CustomerId' to access your Bank account:"); String name=sc.nextLine(); String customerId=sc.nextLine(); BankAccount obj1=new BankAccount(name,customerId); obj1.menu(); } } class BankAccount{ double bal;
  • 2. double prevTrans; String customerName; String customerId; BankAccount(String customerName,String customerId){ this.customerName=customerName; this.customerId=customerId; } void deposit(double amount){ if(amount!=0){ bal+=amount; prevTrans=amount; } } void withdraw(double amt){ if(amt!=0 && bal>=amt){ bal-=amt; prevTrans=-amt; } else if(bal<amt){ System.out.println("Bank balance insufficient"); } } void getPreviousTrans(){ if(prevTrans>0){ System.out.println("Deposited: "+prevTrans); } else if(prevTrans<0){ System.out.println("Withdrawn: "+Math.abs(prevTrans)); } else{ System.out.println("No transaction occured"); } } void menu(){ char option; Scanner sc=new Scanner(System.in); System.out.println("Welcome "+customerName); System.out.println("Your ID:"+customerId); System.out.println("n"); System.out.println("a) Check Balance"); System.out.println("b) Deposit Amount"); System.out.println("c) Withdraw Amount"); System.out.println("d) Previous Transaction"); System.out.println("e) Exit"); do{ System.out.println("********************************************"); System.out.println("Choose an option"); option=sc.next().charAt(0); System.out.println("n");
  • 3. switch (option){ case 'a': System.out.println("......................"); System.out.println("Balance ="+bal); System.out.println("......................"); System.out.println("n"); break; case 'b': System.out.println("......................"); System.out.println("Enter a amount to deposit :"); System.out.println("......................"); double amt=sc.nextDouble(); deposit(amt); System.out.println("n"); break; case 'c': System.out.println("......................"); System.out.println("Enter a amount to Withdraw :"); System.out.println("......................"); double amtW=sc.nextDouble(); withdraw(amtW); System.out.println("n"); break; case 'd': System.out.println("......................"); System.out.println("Previous Transaction:"); getPreviousTrans(); System.out.println("......................"); System.out.println("n"); break; case 'e': System.out.println("......................"); break; default: System.out.println("Choose a correct option to proceed"); break; } }while(option!='e'); System.out.println("Thank you for using our banking services"); } }
  • 5. Overall Banking System With step by step process given the image below: THANK YOU