Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago