Answers for "bank class"

0

bank class

public class Account {
    private int number;
    private double balance;
    private String customername;
    private String customerEmailAdress;
    private String customerPhoneNumber;

//    public Account(){
//        //default Constructor
//        this(1,0.0d,"default","default","default");
//        System.out.println("Defaut constructor created");
//    }
    public Account(int number,double balance,String customername,String customerEmailAdress,String customerPhoneNumber){
        System.out.println("New Account has been created");
        this.number = number ;
        this.balance = balance ;
        this.customername = customername;
        this.customerEmailAdress =customerEmailAdress;
        this.customerPhoneNumber = customerPhoneNumber ;
    }
    public Account(){
        //default Constructor generated first 
        this(1,0.0d,"default","default","default");
        System.out.println("Defaut constructor created");
    }
    public void depoist(double depositeAmount){
        this.balance += depositeAmount;
        System.out.print("Deposit of "+depositeAmount+" made. New balance is "+balance);
    }

    public void withdraw(double withdrowAmount){
        if(this.balance - withdrowAmount < 0){
            System.out.print("only "+balance+" available. withdraw not processed");
        }
        this.balance-=withdrowAmount;
        System.out.print("withdrawal of "+withdrowAmount+"processed. your balance now is"+this.balance);
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(int balance) {
        this.balance = balance;
    }

    public String getCustomername() {
        return customername;
    }

    public void setCustomername(String customername) {
        this.customername = customername;
    }

    public String getCustomerEmailAdress() {
        return customerEmailAdress;
    }

    public void setCustomerEmailAdress(String customerEmailAdress) {
        this.customerEmailAdress = customerEmailAdress;
    }

    public String getCustomerPhoneNumber() {
        return customerPhoneNumber;
    }

    public void setCustomerPhoneNumber(String customerPhoneNumber) {
        this.customerPhoneNumber = customerPhoneNumber;
    }

    public void setbalance(double balance) {
        this.balance = balance;
    }
}
Posted by: Guest on July-14-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language