The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 2 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
**11.8     (New Account class) An Account class was specified in   Programming Exercise 9.7. Design a new Account class as follows:
Â
â– Â Â Â Â Add a new data field name of the String type to store the name of the customer.
Â
â– Â Â Â Â Add a new constructor that constructs an account with the specified name, id, and balance.
Â
â– Â Â Â Â Add a new data field named transactions whose type is ArrayList that stores the transaction for the accounts. Each transaction is an instance of the Transaction class. The Transaction class is defined as shown in Figure 11.6.
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
|
Transaction |
|
-date: java.util.Date -type: char  -amount: double -balance: double -description: String |
|
+Transaction(type: char, amount: double, balance: double, description: String) |
Â
Â
Â
FIGURE 11.6Â Â Â The Transaction class describes a transaction for a bank account.
Â
Â
Â
Â
Â
â– Â Â Â Â Modify the withdraw and deposit methods to add a transaction to the
Â
transactions array list.
Â
â– Â Â Â Â All other properties and methods are the same as in Programming Exercise 9.7.
Â
Write a test program that creates an Account with annual interest rate 1.5%, balance 1000, id 1122, and name George. Deposit $30, $40, and $50 to the account and withdraw $5, $4, and $2 from the account. Print an account sum- mary that shows account holder name, interest rate, balance, and all transactions.
Â
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll