// Author: 0626108 LF02
// Purpose: To manipulate values in a bank account

public class BankAccount {

    private String accountNumber;
    private String password;
    private Double balance;

    public BankAccount() {
	/* Purpose: Class constructor. declares variables
	Precondition: The object doesn't exist yet
	Postcondition: An object will be constructed with empty variables */
        this.accountNumber = null;
        this.password = null;
        this.balance = 0.0;
    }

    public double getBalance() {
    /* Purpose: retrieves current balance
    Precondition:
    Postcondition: returns a value */

        return this.balance;
    }

    public String getPassword() {
    /* Purpose: retrieves current password
	Precondition: this.password must have a value
	Postcondition: no changes */

        return this.password;
    }

    public String getAccountNumber() {
    /* Purpose: retrieves current account number
	Precondition: this.accountNumber must have a value
	Postcondition: no change */

        return this.accountNumber;
    }

    public void setPassword(String newPassword) {
    /* Purpose: Changes password
    Precondition: this.password may or may not have a value
    Postcondition: this.password will have a new value */

        this.password = newPassword;
    }

    public void setAccountNumber(String newAccountNumber) {
    /* Purpose: Changes account number
    Precondition: this.accountNumber may or may not have a value
    Postcondition: this.accountNumber will have a new value */
        this.accountNumber = newAccountNumber;
    }

    public void setBalance(Double newBalance) {
    /* Purpose: Changes balance
    Precondition: this.balance may or may not have a value
    Postcondition: this.balance will have a new value*/
        this.balance = newBalance;
    }

    public void modifyBalance(double amount) {
    /* Purpose: adds a double to this.balance
    Precondition: this.getBalance must have a retrievable value
    Postcondition: this.getBalance may be increased or decreased */
        this.setBalance(this.getBalance() + amount);
    }

}

