Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. package com.un4;
  2.  
  3. /**
  4. * Created by UN4CKN0WL3Z on 21/08/2017.
  5. */
  6. public class Account {
  7.  
  8. private String number;
  9. private double balance;
  10. private String customerName;
  11. private String customerEmailAddress;
  12. private String customerPhoneNumber;
  13.  
  14. public Account(){
  15. this("56789",2.50,"Default name","defualt email address",
  16. "Default Phone number");
  17. System.out.println("Empty constructor called");
  18.  
  19.  
  20. }
  21. public Account(String number, double balance, String customerName,
  22. String customerEmailAddress, String customerPhoneNumber){
  23. System.out.println("Account constructor with parameters called");
  24. this.number = number;
  25. this.balance = balance;
  26. this.customerName = customerName;
  27. this.customerEmailAddress = customerEmailAddress;
  28. this.customerPhoneNumber = customerPhoneNumber;
  29.  
  30. }
  31.  
  32.  
  33. public Account(String customerName, String customerEmailAddress, String customerPhoneNumber) {
  34. this("99999",100.55,customerName,customerEmailAddress,customerPhoneNumber);
  35. System.out.println("return to refer");
  36. }
  37.  
  38. public void deposit(double depositAmount){
  39. this.balance += depositAmount;
  40. System.out.println("Deposit of : " + depositAmount +" made. New balance is : " + this.balance);
  41.  
  42. }
  43.  
  44.  
  45. public void Withdraw(double withDrawAmount){
  46. if(this.balance - withDrawAmount < 0){
  47. System.out.println("Only : " + this.balance + " available. Withdraw not processed.");
  48. }else{
  49.  
  50. this.balance -= withDrawAmount;
  51. System.out.println("Withdraw of :" + withDrawAmount + " Remaining balance is :" + this.balance);
  52. }
  53.  
  54. }
  55.  
  56.  
  57.  
  58.  
  59. public String getNumber() {
  60. return number;
  61. }
  62.  
  63. public void setNumber(String number) {
  64. this.number = number;
  65. }
  66.  
  67. public double getBalance() {
  68. return balance;
  69. }
  70.  
  71. public void setBalance(double balance) {
  72. this.balance = balance;
  73. }
  74.  
  75. public String getCustomerName() {
  76. return customerName;
  77. }
  78.  
  79. public void setCustomerName(String customerName) {
  80. this.customerName = customerName;
  81. }
  82.  
  83. public String getCustomerEmailAddress() {
  84. return customerEmailAddress;
  85. }
  86.  
  87. public void setCustomerEmailAddress(String customerEmailAddress) {
  88. this.customerEmailAddress = customerEmailAddress;
  89. }
  90.  
  91. public String getCustomerPhoneNumber() {
  92. return customerPhoneNumber;
  93. }
  94.  
  95. public void setCustomerPhoneNumber(String customerPhoneNumber) {
  96. this.customerPhoneNumber = customerPhoneNumber;
  97. }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement