Tell me if this makes sense structurally. I have a final this week and this homework will not be graded till after the final. I was just curious if I have as firm a grasp on this as I think I do.
public class account {
private int id = 0;
private double balance = 0;
private double annualInterestRate = 0;
java.util.Date dateCreated = new java.util.Date();
public account(){
int defaultAccount = 0;
}
public account(int setId, int intialBalance){
id = setId;
balance = intialBalance;
}
public return getMonthlyInterestRate(annualInterestrate){
monthlyinterestrate =annualInterestRate/12;
return monthlyInterestRate;
}
public return withdraw(balance, withdrawlAmount){
balance = balance - withdrawlAmount;
return balance;
}
public return deposit(balance, depositAmount){
balance = balance + depositAmount;
return balance;
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int id = 1122;
double balance = 20000;
double annualInterestRate = 4.5;
double withdrawlAmount = 2500;
double depositAmount = 3000;
System.out.println("The balance after withdrawing $2500 is $"+ withdraw(balance,withdrawlAmount));
System.out.println("The balance after depositing $3000 is $"+ deposit(balance,depositAmount));
System.out.println("The monthly interest rate is "+getMonthlyInterestRate(annualInterestRate)+"%.");
System.out.println("The date the account was created is"+dateCreated+".");
}
}