Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In NetBeans create a project. 3.) Build an Account class. The Account class should have 3 Properties: balance, owner and acctNo. The Account class should

In NetBeans create a project. 3.) Build an Account class. The Account class should have 3 Properties: balance, owner and acctNo. The Account class should have 2 constructors, one that takes all 3 properties in the order shown and one that takes no data(the default constructor). The Account class should have set and get methods as well as deposit and withdraw methods. See the UML diagram (note the getters and setters are assumed in the diagram). The method signatures need to look like the ones in the diagram. 4.) Create a JUnit tester to test out this class. 5.) Substitute the provided AccountTest.java class for the tester you created. 6.) Build an InsufficientFundsException class. Have this class extend from the Exception class. Also modify your Account class. Make it so that when the withdraw method or this setBalance method attempts to set the balance below zero, the InsufficientFundsException will be thrown. 7.) Now in your JUnit tester modify the withdraw() test method that will attempt to withdraw more than the current balance has available. Change the setBalance() test method too. What happens now? 8.) Lastly modify your JUnit test for overdrawing the account so that it catches exceptions, and catch the InsufficientFundsException. Retest. What happens now?

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

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

Is the person willing to deal with the consequences?

Answered: 1 week ago

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago