HELP. IDK HOW TO DO THIS NEXT PART?
"The account class was
defined to model a bank account. An account has the properties account number,
balance, annual interest rate, and date created, and methods to deposit and withdraw funds. Create two subclasses for checking and saving accounts. A checking
account has an overdraft limit, but a savings account cannot be overdrawn."
import java.util.Date;
import java.util.Scanner;
public class Account {
private int id = 0;
private double balance = 0;
private double annualInterestRate = 0;
private final Date dateCreated = new Date();
public Account() {
}
public Account(int id, double balance) {
this.id = id;
this.balance = balance;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public double getBalance() {
return balance;
}
public void setBalance(double balance) {
this.balance = balance;
}
public double getAnnualInterestRate() {
return annualInterestRate;
}
public void setAnnualInterestRate(double annualInterestRate) {
this.annualInterestRate = annualInterestRate;
}
public Date getDateCreated() {
return dateCreated;
}
public double getMonthlyInterestRate() {
return annualInterestRate/12;
}
public double getMonthlyInterest() {
return getMonthlyInterestRate() * balance;
}
public void withdraw(double withDrawAmount) {
System.out.println("How much would you like to withdraw?");
balance -= withDrawAmount;
System.out.println("You withdrew " + withDrawAmount + " and your balance is now " + balance);
}
public void deposit(double depositAmount) {
System.out.println("How much would you like to deposit?");
balance += depositAmount;
System.out.println("You deposited " + depositAmount + " and your balance is now " + balance);
}
}