-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ca44fd
commit 965838b
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package Constructor; | ||
public class Account { | ||
|
||
private String number; | ||
private double balance; | ||
private String customerName; | ||
private String customerEmail; | ||
private String customerPhone; | ||
|
||
public Account() { | ||
System.out.println("Empty constructor called"); | ||
} | ||
|
||
public Account(String number, double balance, String customerName, String email, | ||
String phone) { | ||
System.out.println("Account constructor with parameters called"); | ||
this.number = number; | ||
this.balance = balance; | ||
this.customerName = customerName; | ||
customerEmail = email; | ||
customerPhone = phone; | ||
} | ||
|
||
public void depositFunds(double depositAmount) { | ||
|
||
balance += depositAmount; | ||
System.out.println("Deposit of $" + depositAmount + " made. New balance is $" + | ||
balance); | ||
} | ||
|
||
public void withdrawFunds(double withdrawalAmount) { | ||
|
||
if (balance - withdrawalAmount < 0) { | ||
System.out.println("Insufficient Funds! You only have $" + balance + | ||
" in your account."); | ||
} else { | ||
balance -= withdrawalAmount; | ||
System.out.println("Withdrawal of $" + withdrawalAmount + | ||
" processed, Remaining balance = $" + 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 getCustomerEmail() { | ||
return customerEmail; | ||
} | ||
|
||
public void setCustomerEmail(String customerEmail) { | ||
this.customerEmail = customerEmail; | ||
} | ||
|
||
public String getCustomerPhone() { | ||
return customerPhone; | ||
} | ||
|
||
public void setCustomerPhone(String customerPhone) { | ||
this.customerPhone = customerPhone; | ||
} | ||
} |