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;
    }
}

4.83
5
A-312 69370 points

                                    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,&quot;default&quot;,&quot;default&quot;,&quot;default&quot;);
//        System.out.println(&quot;Defaut constructor created&quot;);
//    }
    public Account(int number,double balance,String customername,String customerEmailAdress,String customerPhoneNumber){
        System.out.println(&quot;New Account has been created&quot;);
        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,&quot;default&quot;,&quot;default&quot;,&quot;default&quot;);
        System.out.println(&quot;Defaut constructor created&quot;);
    }
    public void depoist(double depositeAmount){
        this.balance += depositeAmount;
        System.out.print(&quot;Deposit of &quot;+depositeAmount+&quot; made. New balance is &quot;+balance);
    }

    public void withdraw(double withdrowAmount){
        if(this.balance - withdrowAmount &lt; 0){
            System.out.print(&quot;only &quot;+balance+&quot; available. withdraw not processed&quot;);
        }
        this.balance-=withdrowAmount;
        System.out.print(&quot;withdrawal of &quot;+withdrowAmount+&quot;processed. your balance now is&quot;+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;
    }
}

4.83 (6 Votes)
0
3.7
9
Phoenix Logan 186120 points

                                    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,&quot;default&quot;,&quot;default&quot;,&quot;default&quot;);
//        System.out.println(&quot;Defaut constructor created&quot;);
//    }
    public Account(int number,double balance,String customername,String customerEmailAdress,String customerPhoneNumber){
        System.out.println(&quot;New Account has been created&quot;);
        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,&quot;default&quot;,&quot;default&quot;,&quot;default&quot;);
        System.out.println(&quot;Defaut constructor created&quot;);
    }
    public void depoist(double depositeAmount){
        this.balance += depositeAmount;
        System.out.print(&quot;Deposit of &quot;+depositeAmount+&quot; made. New balance is &quot;+balance);
    }

    public void withdraw(double withdrowAmount){
        if(this.balance - withdrowAmount &lt; 0){
            System.out.print(&quot;only &quot;+balance+&quot; available. withdraw not processed&quot;);
        }
        this.balance-=withdrowAmount;
        System.out.print(&quot;withdrawal of &quot;+withdrowAmount+&quot;processed. your balance now is&quot;+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;
    }
}

3.7 (10 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source