|
| 1 | +public class Account { |
| 2 | + private String number; |
| 3 | + private double balance; |
| 4 | + private String customerName; |
| 5 | + private String customerEmailaddress; |
| 6 | + private String customerPhonenumber; |
| 7 | + |
| 8 | + public Account(){ |
| 9 | + System.out.println("Empty Constructor called"); |
| 10 | + } |
| 11 | + public Account(String number,double balance,String customerName,String customerEmailaddress,String customerPhonenumber){ |
| 12 | + this.number=number; |
| 13 | + this.balance=balance; |
| 14 | + this.customerName=customerName; |
| 15 | + this.customerEmailaddress=customerEmailaddress; |
| 16 | + this.customerPhonenumber=customerPhonenumber; |
| 17 | + |
| 18 | + } |
| 19 | + |
| 20 | + public void deposit(double depositAmount){ |
| 21 | + this.balance+=depositAmount; |
| 22 | + System.out.println("Now the available balance is: "+this.balance); |
| 23 | + } |
| 24 | + public void withdrawl(double withdrawlAmount){ |
| 25 | + if(this.balance-withdrawlAmount<0){ |
| 26 | + System.out.println("Only balance available "+this.balance+" only available"); |
| 27 | + |
| 28 | + } |
| 29 | + else { |
| 30 | + this.balance-=withdrawlAmount; |
| 31 | + System.out.println("Withdrwal amount processesd "+withdrawlAmount); |
| 32 | + } |
| 33 | + } |
| 34 | + |
| 35 | + public String getNumber() { |
| 36 | + return number; |
| 37 | + } |
| 38 | + |
| 39 | + public void setNumber(String number) { |
| 40 | + this.number = number; |
| 41 | + } |
| 42 | + |
| 43 | + public double getBalance() { |
| 44 | + return balance; |
| 45 | + } |
| 46 | + |
| 47 | + public void setBalance(double balance) { |
| 48 | + this.balance = balance; |
| 49 | + } |
| 50 | + |
| 51 | + public String getCustomerName() { |
| 52 | + return customerName; |
| 53 | + } |
| 54 | + |
| 55 | + public void setCustomerName(String customerName) { |
| 56 | + this.customerName = customerName; |
| 57 | + } |
| 58 | + |
| 59 | + public String getCustomerEmailaddress() { |
| 60 | + return customerEmailaddress; |
| 61 | + } |
| 62 | + |
| 63 | + public void setCustomerEmailaddress(String customerEmailaddress) { |
| 64 | + this.customerEmailaddress = customerEmailaddress; |
| 65 | + } |
| 66 | + |
| 67 | + public String getCustomerPhonenumber() { |
| 68 | + return customerPhonenumber; |
| 69 | + } |
| 70 | + |
| 71 | + public void setCustomerPhonenumber(String customerPhonenumber) { |
| 72 | + this.customerPhonenumber = customerPhonenumber; |
| 73 | + } |
| 74 | +} |
0 commit comments