I need to create a bank account class which consists of deposit and withdraw methods. I need to have a current account and savings account?
I also need help on how to extend it so I can ask the user to inpt their withdrawal amount and deposit and it gives out the balance using scanner funtion?
So far i have something like this, isit right?..
public abstract class BankAccount {
private double balance;
public BankAccount() {
balance = 0.;
}
public void deposit(double amount) {
balance += amount;
}
public withdraw(double amount) {
// check...
balance -= amount;
}
}
public class CurrentAccount extends BankAccount {
// additional stuff
}
public class SavingsAccount extends BankAccount {
// aditional stuff
}