Question: Please answer this question. Account class and testAccount exist in this site. please use throw illegal argument exception in account class. and use try catch

Please answer this question. Account class and testAccount exist in this site. please use throw illegal argument exception in account class. and use try catch in main class.

Program #3 (24 points): Modify class account from assignment #8 to throw illegal argument exception if the initial balance amount, deposit amount, withdraw amount, or interest rate is less than or equal to zero. Modify the test program to show how invalid negative values for these variables would throw illegal argument exceptions Use proper and meaningful error messages. The following is a sample run that shows the result of calling method toString() on an object followed by the output for an attempt to withdraw a negative amount from the account. ----jGRASP exec: java -ea TestAccountWithExceptions

Account ID: 123456 Account Balance: $7,000.00

Interest Rate: 2.5% Monthly interest: $14.58

Date Opened: Fri Nov 09 12:08:27 EST 2018

Invalid Input: Withdraw amount must be positive.

----jGRASP: operation complete.

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!