Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8605631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:53:08+00:00 2026-06-12T02:53:08+00:00

Okay so I have a driver class called MonthlyReport that reads in data from

  • 0

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;

        }
   }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:53:09+00:00Added an answer on June 12, 2026 at 2:53 am

    You could write a custom class which contains both of the arrays datatypes and combine the information from your .dat files into an array of this new type

    public class CustomerAccounts
    {
        public Account[] Account {get; set;}
        public Customer Customer {get; set;}
    }
    
    
    public class MonthlyReport() {
       public static void main(String args[]){
    
             CustomerAccounts[] allData = new CustomerAccounts[totalCustomers];
    
             //Read in customers
             for (i = 0; i < totalCustomers; i++)
             {
                   Customer c = new Customer(customerID, firstName, lastName, mailingAddress, emailAddress, flag, accountNum);
                   CustomerAccounts customerAccount = new CustomerAccounts()'
                   customerAccount.customer = c;
                   allData [i] = customerAccount;
    
             }
    
             for (i = 0; i < totalAccounts; i++)
             {
                  Account a = new Account(accountNumber, accountType, balance, openingDates, aprAdjustment, feeAdjustment);
    
                  //Look up customer account belongs to to get index in all data array
                  int index = lookupIndex();
    
                  CustomerAccounts customerAccount = allData [index];
                  int numberOfAccounts = customerAccount.accounts.count;
                  allData [index].accounts[numberOfAccounts] = a;
             }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay i have a custom server control that has some autocomplete settings, i have
I have a VARCHAR(4) column that receives data from an input that may be
I have a project that has some files that are fragile in a sense
Okay I have a large CRUD app that uses tabs with Forms embedded in
Okay I have a series of objects based on a base class which are
Okay i have two models: posts and comments. as you can think comments has
I have been trying to authenticate my CGI application through 2 drivers, one that
Okay I have two classes for two links and two divs with different information.
Okay I have three tables that all communicate with each other. ForumTopic t ForumMessage
One of the practices I have gotten into in Python from the beginning is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.