I am missing something in my check sub class and I can't figure it out I know its something simple and I for the life of me can not find it.
package lab61;
public class AccountClass {
public double annualInterestRate;
public double balance;
public int Id;
public java.util.Date dateCreated= new java.util.Date();
public AccountClass(){
}
public AccountClass(int myId,double mybalance, double annualIntRate){
Id = myId;
balance = mybalance;
annualInterestRate = annualIntRate;
dateCreated = getDateCreated();
}
public double getAnnualInterestRate() {
return annualInterestRate;
}
public void setAnnualInterestRate(double annualInterestRate) {
this.annualInterestRate = annualInterestRate;
}
public double getBalance() {
return balance;
}
public void setBalance(double balance) {
this.balance = balance;
}
public int getId() {
return Id;
}
public void setId(int id) {
Id = id;
}
public java.util.Date getDateCreated() {
return dateCreated;
}
public void setDateCreated(java.util.Date dateCreated) {
this.dateCreated = dateCreated;
}
public void withdraw(double amount){
balance = balance-amount;
}
public void deposit(double amount){
setBalance(balance + amount);
}
public double getMonthlyInterest(){
double monthlyIntRate = (getAnnualInterestRate() /12);
return (balance * monthlyIntRate/100);
}
}
CHECK ACCOUNT
package lab61;
import java.util.Date;
public class Checking extends AccountClass {
public String accountType;
public String getAlert;
public Checking(double balance) {
// TODO Auto-generated constructor stub
}
public Checking(double annualInterestRate, double balance, int id,
Date dateCreated, String accountType, String getAlert) {
super();
}
public Checking(int myId, double mybalance, double annualIntRate,String accountType, String getAlert) {
super(myId, mybalance, annualIntRate);
// TODO Auto-generated constructor stub
}
public void deposit(double amount){
super.deposit(amount);
}
public void withdraw(double amount){
super.withdraw(amount);
}
public String getChecking() {
return accountType;
}
public void setAccountType(String accountType) {
this.accountType = accountType;
}
public String getGetAlert() {
return getAlert;
}
public void setGetAlert(String getAlert) {
this.getAlert = getAlert;
}
}
CHECKING OUTPUT
package lab61;
public class CheckingDemo {
public CheckingDemo() {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Checking check = new Checking(1122, 20000, 4.5);
check.withdraw(10000);
check.deposit(3000);
System.out.println("Account type is " + check.accountType());
System.out.println("Balance is " + check.getBalance());
System.out.println("Monthly interest is " + check.getMonthlyInterest());
System.out.println(check.setGetAlert(10000));
System.out.println("This account was created at " + check.getDateCreated());
}
}