Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA Write a BankAccount class and a custom Exception class to handle deposits and withdraws operations. The BankAccount class should have three main methods, withdraw,
JAVA
Write a BankAccount class and a custom Exception class to handle deposits and withdraws operations. The BankAccount class should have three main methods, withdraw, deposit and Monthly_Dividend. While the custom Exception class "NotEnoughBalance "should contain an amount and a message to tell what the reason was for the Exception. The following list shows each class details NotEnoughBalance Class: This class inherits from Exception class. Attributes double Amount o Amount that caused this exception Methods: Implement the following 4 constructors and call the corresponding super class: NotEnoughBalance 0 NotEnoughBalance (double amount, Throwable cause) NotEnoughBalance (double amount, String message) NotEnoughBalance (double amount, String message,_Throwablee cause) BankAccount Class Attributes: double Balance o Holds the balance in this account double Yearly_Dividend Yearly returned Dividend Methods: Void deposit(double amount); o A method that will accept an amount to depositStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started