Question: public class Account { // data fields private int ACCNumber; private double ACCBalance; private String CustomerID; private String DebitNo; private String BName; private String BID;

public class Account {

// data fields

private int ACCNumber;

private double ACCBalance;

private String CustomerID;

private String DebitNo;

private String BName;

private String BID;

private String CreditNo;

private double MaxCredit;

//Savings Account

public Account(int ACCNumber, String CustomerID, double ACCBalance) {

this.ACCNumber = ACCNumber;

this.CustomerID = CustomerID;

this.ACCBalance = ACCBalance;}

//Checking Account

public Account(int ACCNumber, String CustomerID, double ACCBalance, String DebitNo)

{

this.ACCNumber = ACCNumber;

this.CustomerID = CustomerID;

this.ACCBalance = ACCBalance;

this.DebitNo = DebitNo;

}

//Business Account

public Account (int ACCNumber, String CustomerID, double ACCBalance, String BName, String BID)

{

this.ACCNumber = ACCNumber;

this.CustomerID = CustomerID;

this.ACCBalance = ACCBalance;

this.BName = BName;

this.BID = BID;

}

//Credit Card Account

public Account(String CustomerID, String CreditNo, double ACCBalance, double MaxCredit)

{

this.CustomerID = CustomerID;

this.CreditNo = CreditNo;

this.ACCBalance = ACCBalance;

this.MaxCredit = MaxCredit;

}

public String getCreditNo() {return CreditNo;}

public void setCreditNo(String CreditNo) {this.CreditNo = CreditNo;}

public double getMaxCredit() {return MaxCredit;}

public void setMaxCredit(double MaxCredit) {this.MaxCredit = MaxCredit;}

public String getDebitNo() {return DebitNo;}

public void setDebitNo(String DebitNo) {this.DebitNo = DebitNo;}

public String getBID() {return BID;}

public void setBID(String BID) {this.BID = BID;}

public String getBName() {return BName;}

public void setBName(String BName) {this.BName = BName;}

public String getCustomerID() {return CustomerID;}

public void setCustomerID(String CustomerID) {this.CustomerID = CustomerID;}

public int getACCNumber() {return ACCNumber;}

public void setACCNumber(int ACCNumber) {this.ACCNumber = ACCNumber;}

public double getACCBalance() {return ACCBalance;}

public void setACCBalance(double ACCBalance) {this.ACCBalance = ACCBalance;}

public class Customer{

private String ID;

private String LName;

private String FName;

private String Address;

private String City;

public Customer(String ID, String LName, String FName, String Address, String City)

{

this.ID =ID;

this.LName = LName;

this.FName = FName;

this.Address = Address;

this.City = City;

}

public String getID() {return ID;}

public void setID(String iD) {ID = iD;}

public String getLName() { return LName;}

public void setLName(String LName) {this.LName = LName;}

public String getFName() {return FName;}

public void setFName(String FName) {this.FName = FName;}

public String getAddress() {return Address;}

public void setAddress(String Address) {this.Address = Address;}

public String getCity() {return City;}

public void setCity(String City) {this.City = City;}}

Q: In the main class, write a method getDataFromFile to read data from a given file. This method should read data from the file, create appropriate objects for the customer and account, save the data into an array.

Make sure to use Scanner, not the BufferedReader.

If the account is Checking, order is CustomerID - LName - FName - Address - City - AccountType - ACCNumber - ACCBalance - DebitNo

If the account is Savings, order is CustomerID - LName - FName - Address - City - AccountType - ACCNumber- ACCBalance

If the account is Business, order is CustomerID - LName - FName - Address - City - AccountType - ACCNumber - ACCBalance - BName - BID

If the account is CreditCard, order is CustomerID - LName - FName - Address - City - AccountType - CreditNo - ACCBalance - MaxCredit

THis is the .txt that has to be used

C8392380567 Sage, Amy Ping Ting Road Edmonton Checking 873387 5000 0000-6666-6666-6666

C8954385123 Lee, Bob Texaco Road Calgary Savings 827366 9480

C2389490434 Neil, Carson Deerfoot Trail Otawa Business 763655 65000 Emporia LLC 87-927736

C9384899234 Ko, David Unversity Drive Stillwater CreditCard 7667-9899-8776-1234 430 4000

C0930238083 Warren, John Ogden Road Tyler Checking 726615 1230 0000-2222-2222-2222

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!