Okay so I have a driver class called MonthlyReport that reads in data from 2 different .dat files, one has information regarding accounts and another has information regarding customers. In my driver class I create 2 arrays of objects that store the information on accounts and customers respectively. The problem is that once I have sent the customer data to the customer class, I am not sure how to specify which account belongs to each customer and cannot modify the information in their account based on who they are.
So basically, I want to access the corresponding account object to its customer but I am not sure how to access the object that is created in MonthlyReport from the Customer class. It is more of a conceptual problem and I do not necessarily need code so much as I need a design suggestion. I can add some of my code up if it helps to answer the question. Thanks in advance.
public class MonthlyReport() {
public static void main(String args[]){
//reading in account data here
Account a = new Account(accountNumber, accountType, balance, openingDates, aprAdjustment, feeAdjustment);
accounts[i]=a;
//reading in customer data here
Customer c = new Customer(customerID, firstName, lastName, mailingAddress, emailAddress, flag, accountNum);
customers[i]= c;
}
}