Banking Project in core java - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Banking Project in core java banking project core java

Banking Project in core java



Banking Project in core java

import java.util.*;
class Customer1

{
public static String bankName="ShashiBank";
public String name;
public double balance;

 Customer1(String name)
{
  this.name=name;


}
public void deposit(Double amount)
{
this.balance=this.balance+amount;
System.out.println("Avaiable amount  is:"+this.balance );
}
public void withdraw(Double amount)
{
if(amount>balance)
{
System.out.println("In your Account infficiant balance");
           System.exit(0);
}
else{
balance=balance-amount;
System.out.println("total Avaiable amount"+balance);
}
}

public static void main(String[]args)
{
System.out.println("\t--------Welcome to "+Customer1.bankName+"---------");
    Scanner sc=new Scanner(System.in);
    System.out.println("Enter Your Name");
     String name=sc.next();
Customer1 c1=new Customer1(name);
System.out.println(c1.name+"Your Account is created");
while(true)
{


System.out.println("Chose Your Option ");

System.out.println("D-Deposite\nW-Withdraw\nE-Exit");
String option =sc.next();
if (option.equalsIgnoreCase("D"))
{
System.out.println("Enter Amount:");
double amount=sc.nextDouble();
c1.deposit(amount);
}
else if(option.equalsIgnoreCase("W"))

{
System.out.println("Withdraw Your amount");
 double amount=sc.nextDouble();
 c1.withdraw(amount);
}
else if (option.equalsIgnoreCase("E")) {
System.out.println("Thanks for using bank");

System.exit(0);
}
else{
System.out.println("Invailed option please chose the right option");
}


}

 
}
}

About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.