Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

As a follow up to Assignment1, modify the CheckingAccount class to add the following instance members: an array(self expanding type) or ArrayList of Transaction objects

As a follow up to Assignment1, modify the CheckingAccount class to add the following instance members: an array(self expanding type) or ArrayList of Transaction objects and a int variable transCount(incremented each time a new Transaction object is created). Create a Transaction class that stores an int transNumber(will be the current value of transCount), an int transId (1 = check, 2 = deposit 3 = service charge) and a double transAmt. Prompt the user for the choice of a) entering a transaction, b) listing all transations, c) listing all checks, d) listing all deposits.(implement these options with JFrame,JLabel, JRadioButton, ButtonGroup, and a listener) The listings must go to a Dialog box. Add instance methods to the CheckingAccount class like addTrans(put a trans into the account), getTrans(get a transaction from the array) getTransCount(get the current value of transCount class variable) and any other methods you wish to implement. This program is event-driven. You cannot put all the processing steps/logic in main. You can put them in helper methods in the Main class, in the GUI objects class, or in the CheckingAccount class, so they can be called by the listener method.

New data and methods for the CheckingAccount Class

---------------------------------------------------------------------------

private ArrayList transList; // keeps a list of Transaction objects for the account

private int transCount; // the count of Transaction objects and used as the ID for each transaction

public void addTrans( Transaction newTrans) // adds a transaction object to the transList

public int gettransCount() //returns the current value of transCount;

public Transaction getTrans(int i) // returns the i-th Transaction object in the list

--------------------------------------------------------------------------

New Transaction class

public class Transaction

{

private int transNumber;

private int transId;

private double transAmt;

public Transaction(int number, int id, double amount)

{

transNumber = number;

transId = id;

transAmt = amount;

}

public int getTransNumber()

{

return transNumber;

}

public int getTransId()

{

return transId;

}

public double getTransAmount()

{

return transAmt;

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

Evaluate the importance of diversity in the workforce.

Answered: 1 week ago

Question

Identify the legal standards of the recruitment process.

Answered: 1 week ago