This program creates 10 accounts and sets the balance to $100 each.
I wrote a for loop to initialize the balance but doesn't work. The setBalance() method is not recognize within the AccountArray Class How do I assign $100 balance to each account?
public class AccountArray{
public static AccountArray[] createAccountArray(){
AccountArray[] atm = new AccountArray [10];
for(int i = 0; i < atm.length; i++){
    atm[i] = new AccountArray(setBalance(100));
}
return atm;
  }
}
import java.util.Date;
public class Account{
    public int id = 0;
    public double balance = 0;
    public double annualInterestRate = 0;
    public double withdraw;
    public double deposit;
    java.util.Date date = new java.util.Date();
public Account(){
}
public Account(int id, double balance, double annualInterestRate){
    this.id = id;
    this.balance = balance;
    this.annualInterestRate = annualInterestRate;
}
public Account(int id, double balance, double annualInterestRate, Date date){
    this.id = id;
    this.balance = balance;
    this.annualInterestRate = annualInterestRate;
    this.date = date;
}
public void setID(int id){
    this.id = id; 
}
public int getID(){
    return id;
}
public double getBalance(){
    return balance - withdraw + deposit;
}
public void setAnnualInterestRate(double annualInterestRate){
    this.annualInterestRate = annualInterestRate;
}
public double getAnnualInterestRate(){
    return (annualInterestRate/100);
}
public Date getDateCreated(){
    return date;
}
public double getMonthlyInterestRate(){
    return getBalance() * ((annualInterestRate/100) / 12); 
}
public void withdraw(double withdraw){
    this.withdraw = withdraw;
}
public double deposit(){
    return balance + deposit;
}
public void deposit (double deposit){
    this.deposit = deposit;
}
}
.
public class TestAccount extends AccountArray{
public static void main(String[] args) {
    Account account1122 = new Account(1122, 20000, 4.5);
    account1122.withdraw(2500);
    account1122.deposit(3000);
    System.out.println("Your account balance is: \t" + "$"+ account1122.getBalance() + 
            "\nYour monthly interest rate is: \t" + "$" + account1122.getMonthlyInterestRate() + 
            "\nYour account was created on: \t" + account1122.getDateCreated());
    //Declare account array */
    AccountArray[] atm;
    //Create Account array */
    atm = createAccountArray();
    System.out.println(atm[i].getBalance);
    }
}
 
     
    