Commit a4870f53 authored by jose.alencastro's avatar jose.alencastro

ok

parent 4b119eaf
No preview for this file type
...@@ -8,20 +8,14 @@ public class BankAccount ...@@ -8,20 +8,14 @@ public class BankAccount
// contructor method // contructor method
public BankAccount() public BankAccount()
{ {
accountNumber = 12345; accountNumber = 24680;
name = "Ben"; name = "Ben";
balance = 1000; balance = 4000;
} }
// deposit method // withdraw method
public void deposit(double amount) public void withdraw(double amount)
{ {
balance = balance + amount;
}
// withdraw method
public void withdraw(double amount)
{
if (amount <= balance) if (amount <= balance)
{ {
balance = balance - amount; balance = balance - amount;
...@@ -34,6 +28,12 @@ public class BankAccount ...@@ -34,6 +28,12 @@ public class BankAccount
} }
} }
// deposit method
public void deposit(double amount)
{
balance = balance + amount;
}
// bank fee method // bank fee method
public double bankFee() public double bankFee()
{ {
...@@ -52,9 +52,9 @@ public class BankAccount ...@@ -52,9 +52,9 @@ public class BankAccount
public static void main(String[] args) public static void main(String[] args)
{ {
BankAccount bensAccount = new BankAccount(); BankAccount bensAccount = new BankAccount();
bensAccount.deposit(200); bensAccount.deposit(100);
bensAccount.bankFee(); bensAccount.bankFee();
bensAccount.withdraw(1300); bensAccount.withdraw(2000);
bensAccount.displayAccountDetails(); bensAccount.displayAccountDetails();
} }
} }
\ No newline at end of file
No preview for this file type
...@@ -58,8 +58,8 @@ public class SavingsAccount ...@@ -58,8 +58,8 @@ public class SavingsAccount
public static void main(String[] args) public static void main(String[] args)
{ {
SavingsAccount bensAccount = new SavingsAccount(); SavingsAccount bensAccount = new SavingsAccount();
bensAccount.deposit(200); bensAccount.deposit(300);
bensAccount.withdraw(50); bensAccount.withdraw(100);
bensAccount.accrueInterest(); bensAccount.accrueInterest();
bensAccount.bankFee(); bensAccount.bankFee();
bensAccount.displayAccountDetails(); bensAccount.displayAccountDetails();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment