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
// contructor method
public BankAccount()
{
accountNumber = 12345;
accountNumber = 24680;
name = "Ben";
balance = 1000;
balance = 4000;
}
// deposit method
public void deposit(double amount)
{
balance = balance + amount;
}
// withdraw method
public void withdraw(double amount)
{
// withdraw method
public void withdraw(double amount)
{
if (amount <= balance)
{
balance = balance - amount;
......@@ -34,6 +28,12 @@ public class BankAccount
}
}
// deposit method
public void deposit(double amount)
{
balance = balance + amount;
}
// bank fee method
public double bankFee()
{
......@@ -52,9 +52,9 @@ public class BankAccount
public static void main(String[] args)
{
BankAccount bensAccount = new BankAccount();
bensAccount.deposit(200);
bensAccount.deposit(100);
bensAccount.bankFee();
bensAccount.withdraw(1300);
bensAccount.withdraw(2000);
bensAccount.displayAccountDetails();
}
}
\ No newline at end of file
No preview for this file type
......@@ -58,8 +58,8 @@ public class SavingsAccount
public static void main(String[] args)
{
SavingsAccount bensAccount = new SavingsAccount();
bensAccount.deposit(200);
bensAccount.withdraw(50);
bensAccount.deposit(300);
bensAccount.withdraw(100);
bensAccount.accrueInterest();
bensAccount.bankFee();
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