Hello everyone,
I am trying to create a program that reads from a file, and outputs the data. The file contains a list of bank accounts with some standard bank account information, also we need to output what the monthly fee for each account is based on certain criteria. Then, after that we need to find the total of all deposits, the average of all accounts, and the average of the savings and the checking accounts located in the file, but this is to be done using polymorphism.
I have gotten quite a lot of the program done, but I am having an issue in getting everything from this file to output correctly, and then to find the average of and total of everything that I need to.
I have five classes all together, one I believe I have finished. I would like to start with analyzing this class, and then moving on.
public class Bank { protected int total; public Bank() { BankAccount myBankAccount = new BankAccount(); System.out.println("There are: " + myBankAccount.getAccountCount() + myBankAccount.getAccountType() + " account in the Bank"); System.out.println("Account #: " + myBankAccount.getAccountNumber()); System.out.println("Account Type: " + myBankAccount.getAccountType()); System.out.println("CustomerName: " + myBankAccount.getCustomerName()); System.out.println("Customer Type: " + myBankAccount.getCustomerType()); System.out.println("Balance: " + myBankAccount.getBalance()); System.out.println("Monthly Fee: " + myBankAccount.getMonthlyFee()); } }
The issue I am having with this class is that I am being told that I am not able to instantiate a BankAccount object. Have I done this right?
Thank you,
Techergy