Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.un4;
- /**
- * Created by UN4CKN0WL3Z on 21/08/2017.
- */
- public class Account {
- private String number;
- private double balance;
- private String customerName;
- private String customerEmailAddress;
- private String customerPhoneNumber;
- public Account(){
- this("56789",2.50,"Default name","defualt email address",
- "Default Phone number");
- System.out.println("Empty constructor called");
- }
- public Account(String number, double balance, String customerName,
- String customerEmailAddress, String customerPhoneNumber){
- System.out.println("Account constructor with parameters called");
- this.number = number;
- this.balance = balance;
- this.customerName = customerName;
- this.customerEmailAddress = customerEmailAddress;
- this.customerPhoneNumber = customerPhoneNumber;
- }
- public Account(String customerName, String customerEmailAddress, String customerPhoneNumber) {
- this("99999",100.55,customerName,customerEmailAddress,customerPhoneNumber);
- System.out.println("return to refer");
- }
- public void deposit(double depositAmount){
- this.balance += depositAmount;
- System.out.println("Deposit of : " + depositAmount +" made. New balance is : " + this.balance);
- }
- public void Withdraw(double withDrawAmount){
- if(this.balance - withDrawAmount < 0){
- System.out.println("Only : " + this.balance + " available. Withdraw not processed.");
- }else{
- this.balance -= withDrawAmount;
- System.out.println("Withdraw of :" + withDrawAmount + " Remaining balance is :" + this.balance);
- }
- }
- public String getNumber() {
- return number;
- }
- public void setNumber(String number) {
- this.number = number;
- }
- public double getBalance() {
- return balance;
- }
- public void setBalance(double balance) {
- this.balance = balance;
- }
- public String getCustomerName() {
- return customerName;
- }
- public void setCustomerName(String customerName) {
- this.customerName = customerName;
- }
- public String getCustomerEmailAddress() {
- return customerEmailAddress;
- }
- public void setCustomerEmailAddress(String customerEmailAddress) {
- this.customerEmailAddress = customerEmailAddress;
- }
- public String getCustomerPhoneNumber() {
- return customerPhoneNumber;
- }
- public void setCustomerPhoneNumber(String customerPhoneNumber) {
- this.customerPhoneNumber = customerPhoneNumber;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement